How I can get decimal numbers with point istead of comma ( for example in excel number is 234,456.34)
How I can get decimal numbers with point instead of comma ( for example in excel number is 234,456.34)
Could you share your template Excel file (please zip it prior attaching here) and paste your sample code that you are using for your requirements. We will check and help you accordingly. Also, share your environment details with regional/locale settings set of os.
@Amjad_Sahi I use cell.StringValueWithoutFormat for this, But it is also have problems , for example in some cases values in excel is 684 but cell.StringValueWithoutFormat is reeturn 683.999… .
Aspose version is v21.7.0
Please zip and attach your template Excel file, we will check it soon.
ReferenceDoclet_withSingleCell.zip (22 Bytes)
Your zipped archive does not contain any file. Please re-zip your Excel file and attach it again. We will check it soon.
TEst.zip (6.8 KB)
Thanks for the file.
I think you are talking about A1 cell in the sheet. This is not an issue with the APIs rather due to original value stored in the source .xml of the template Excel XLSX file. I used WinRar to open the XLSX file into it and found this value, see the screenshot for your reference.
sc_shot1.png (45.3 KB)
I then processed the sample code using Aspose.Cells to get the same value for Cell.Value attribute, see the screenshot for your reference:
sc_shot2_process_sample code.png (6.3 KB)
I have 2 more questions
- In excel I see the value as
image.png (1.1 KB)
Is There any format that aspose can open file like that?
- We use Aspose.cells library for processing excel files. It is .Net core application. After processing many files suddenly Aspose can’t open files. I restart the program and then it starts to work correcktly agaion.
Thanks a lot for your answers again @Amjad_Sahi
Please note, Aspose.Cells processes the source data saved in Excel files (e.g. in the source .xml file(s)). That’s why Cell.StringValueWithoutFormat just gives string of the original numeric value stored in data model (see my attached screenshot I attached previously). It seems MS Excel modifies certain values or rounds these on its own when you open the file into it.
Moreover, because Cell.StringValueWithoutFormat leads to ambiguity for some users, we have made it obsolete in recent versions and will remove it later in this year. Please parse double values and then get your desired results with your own formatter (using your own code) according to your requirement. For cells, maybe you need to check whether the value in data model (stored) is numeric at first, Cell.IsNumericValue should be helpful for such situations.
This is strange and we cannot think of an issue with Aspose.Cells APIs. The issue might be due to your VS.NET, OS, system configurations or else. If you still think it is an issue with the APIs, kindly do create a separate (simple) console .NET core demo application, zip the project and post us to reproduce the issue on our end, we will check it soon.