We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cell getStringValue inconsistent aspose7

Hi Guys,

I’m working with Aspose.Cells version 7.0.1. We are upgrading from version

I am finding that the getStringValue() method in version 7 returns inconsistent results depending on whether the cell has a format set or not (e.g. Number & Decimal places). In the older version the display value is always returned.

Attached are two excel files with identical tables & values except that the format in one is set to something specific (e.g. Number), while the other one is set to General.

In both files the user sees the same display value in excel. For example a cell contains -0.4 which is what the user sees. The getStringValue in aspose7 returns -0.4 if the cell has a Number format & 1 decimal place setting. However it returns -0.400000001066712 if the setting is General.

In aspose2 it consistently returns the display value of -0.4.

Is there are fix for this in aspose7? Your help on this would be greatly appreciated.




Thanks for the template files.

Well, since you are using older Aspose.Cells version i.e., 7.0.1 which might have such an issue. We highly recommend you to kindly upgrade to and use newer Aspose.Cells for Java version (e.g v16.12.0 (latest)) which works fine as I tested using the following sample code with your template file:
Sample code:

Workbook workbook = new Workbook(“Table1_bestworstquarter_noformat.xls”);
Worksheet worksheet = workbook.getWorksheets().get(0);
Cell cell = worksheet.getCells().get(“C2”);
System.out.println(cell.getStringValue()); //-0.4 - Ok

Thank you.

Thanks Amjad.

Our license allows up to version 7, however if this is a known issue in that version, and there is no workaround available then we will need to consider your recommentation. I will check with our management team for Aspose licensing/upgrade.

I take it that the latest version can be run, without issue on Java 1.6?



Well, yes, it is better to upgrade to latest versions of the Aspose.Cells API as we have made more enhancements and included many new features to make the product more robust and feature rich APIs.

And, sure, latest version of Aspose.Cells for Java does support JDK1.6 and greater versions.

Thank you.