I have trouble reading the decimal value of cells in an excel file when upgrading the system to use the new version of Aspose.
It only happens with cells having value is “1.36” and the Format cell is number in excel file.
With the value “0.36”, “2.36”, or other, the error is not happening.
Here is my code:
DataTable dt = new DataTable();
using (Workbook wb = new Workbook(stream))
using (Worksheet ws = wb.Worksheets[workSheetName])
ExportTableOptions options = new ExportTableOptions();
for (int i = 0; i <= ws.Cells.MaxDataColumn + 1; i++)
dt.Columns.Add().DataType = typeof(string);
options.SkipErrorValue = true;
options.DataTable = dt;
ws.Cells.ExportDataTable(0, 0, ws.Cells.MaxDataRow, ws.Cells.MaxDataColumn, options);
For Aspose version 21.1.0:
- The value read is 1.36
For Aspose version 22.12.0:
- The value read is 1.359999999999
In my business, I CAN NOT use rounding for numbers. I need to get exactly the value in cells without rounding them.
I also try to update to upgrade to the latest stable version of Aspose, but the error still happens.
I tried to change the format cell in the excel file to Text, and the issue is fixed. But my business DOES NOT allow to use other format cells except the format cell number in excel file. So I can’t use this solution.
So I think The Aspose has some issues with the method ExportDataTable() at the latest Version. Can you help me check it? Thanks