https://issues.apache.org/bugzilla/show_bug.cgi?id=56315
Bug ID: 56315
Summary: Floating point rounding problems with ROUND function
Product: POI
Version: 3.10
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
Created attachment 31438
--> https://issues.apache.org/bugzilla/attachment.cgi?id=31438&action=edit
Simple Java program and Excel sheet to reproduce the bug
When running the attached code I get the following output:
A1 numeric: 0.049999999999999975
A3 numeric: 0.0
A3 text: 0
A3 formatted: 0
A4 concatenated: test 0
If I open the spreadsheet in Excel it displays:
A1: 0.05
A3: 0.1
A4: test 0.1
The ROUND function in cell A3 returns 0.0 in POI, while it returns 0.1 in
Excel.
I assume this is because of the problems with storing exact floating point
numbers, but I really think POI and excel should return the same result.
When the value is used in a CONCATENATE function in cell A4, the result from
POI also differs from Excel.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]