poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60354] DataFormatter rounding issues
Date Tue, 08 Nov 2016 20:02:40 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=60354

--- Comment #2 from PJ Fanning <fanningpj@yahoo.com> ---
This issue may be down to my own confusion. We used to have a streaming parser
based on the FromHowTo sample in POI and this code ran into rounding problems.
This appears to be because the worksheet XML actually has the numeric data
already stored as a badly rounded value.
This code does not use the DataFormatter.
For a cell that my workbook displays 9.20 for, the XML in the worksheet has:
<c r="C1" s="2"><v>9.1999999999999993</v></c>

We have now switched to an approach more like the XLSX2CSV POI sample but I've
been wary about equivalent rounding issues and this is why I was interested in
writing a custom DataFormatter to avoid using floating point precision. But it
would appear that the Double logic is actually necessary to handle the fact
that the Excel sheet data doesn't have the actual '9.20' value but an
approximation of it.

-- 
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


Mime
View raw message