Different numbers

Hello,

We are trying to extract numbers from external XLSX files with Aspose Cells v20.11, but they are different from what Excel says.
Is there a way to get exactly the same numbers as Microsoft Excel shows (WYSIWYG)?
We are interested in the value and not the formatting.
The only way we found at the moment is to use Apache POI.

Extract:

Cell cell = new Workbook("test.xlsx").getWorksheets().get(0).getCells().get(0, 0);

System.out.println("Excel formula   : 123.456789012345");// wanted
System.out.println("Apache POI      : " + NumberToTextConverter.toText(cell.getDoubleValue()));// identical
System.out.println("Aspose value    : " + cell.getValue());// 123.4567890123455
System.out.println("Aspose double   : " + cell.getDoubleValue());// 123.4567890123455
System.out.println("Aspose no format: " + cell.getStringValue(CellValueFormatStrategy.NONE));// 123.4567890123455
System.out.println("Aspose display  : " + cell.getStringValue(CellValueFormatStrategy.DISPLAY_STYLE));// 123.4568
System.out.println("Aspose style    : " + cell.getStringValue(CellValueFormatStrategy.CELL_STYLE));// 123.456789
Style style = cell.getStyle();
style.setCustom("#.##############E+00");// simulate 15 significants
cell.setStyle(style);
System.out.println("Aspose custom   : " + cell.getStringValue(CellValueFormatStrategy.CELL_STYLE));// 1.23456789012346E+02

How we created that test file:

Workbook wb = new Workbook();
wb.getWorksheets().get(0).getCells().get(0, 0).setValue(123.4567890123455);
wb.save("test.xlsx");

This could be a bug report for CellValueFormatStrategy.NONE.
Or this could be a feature request to add something like CellValueFormatStrategy.EXCEL or even Cell.getExcelDoubleValue().

Best Regards

@flammang,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSJAVA-43368 - Different numbers extracted by Aspose.Cells