You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2020/07/11 06:50:53 UTC

[Bug 62217] While reading a cell from Spreadsheet the precision is changed from 10 to 6 digits after decimal in 3.17

https://bz.apache.org/bugzilla/show_bug.cgi?id=62217

chenlin <74...@qq.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FAQ

--- Comment #1 from chenlin <74...@qq.com> ---
The getformat() method of the DataFormatter of the 3.12 version directly
obtains the Format class. 

The getformat() function in the dataFormatter of the 3.17 version is changed,
and a new ExcelGeneralNumberFormat class is returned. 
The implementation in dataFormatter.formatCellValue() is implemented by the
getformat() method in the ExcelGeneralNumberFormat class. 
The TO_10_SF constant is used to limit the data length. This restriction does
not exist in the 3.12 version. It can be considered as a version difference. 

This is the code segment where you feel the precision is faulty: 
private static final MathContext TO_10_SF = new MathContext(10,
RoundingMode.HALF_UP); 
final double rounded = new BigDecimal(value).round(TO_10_SF).doubleValue();

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org