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

Free Support Forum - aspose.com

Decimal places returned by Cell getStringValue()

When I run the following code:

public static void main(String[] someArgs) throws Exception
Workbook workbook = new Workbook();

WorksheetCollection worksheets = workbook.getWorksheets();

int sheetIndex = worksheets.add();

Cells cells = worksheets.get(sheetIndex).getCells();

double myValue = 7.186180643663701;


I get the following output:


Why does getStringValue not only return a truncated value, but also a value that is different from the 8th decimal place onwards?

I’m running within NetBeans on Mac as follows:

Product Version: NetBeans IDE 6.9.1 (Build 201011082200)

Java: 1.6.0_26; Java HotSpot™ 64-Bit Server VM 20.1-b02-384

System: Mac OS X version 10.6.8 running on x86_64; MacRoman;
en_US (nb)


Thanks for reporting.

I was able to replicate this issue using the latest version:
Aspose.Cells for Java v7.0.1.5

We have logged this issue in our database. Once the issue will be fixed or we get some update, we will let you know asap.

This issue has been logged as CELLSJAVA-31050.


Please download: Aspose.Cells for Java v7.0.1.6

Currently we do not support to truncate decimal value as ms excel for cell.getStringValue(). However we have fixed the issue of "value that is different from the 8th decimal place onwards”. Because precision of floating-point values, "7.186180643663702” will be returned by Cell.getStringValue() for given double value “7.186180643663701”. We will make enhancements for Cell.getStringValue() to make it same with what shown in ms excel in later versions when we have enough time.

The issues you have found earlier (filed as 31050) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.