Good Morning David and All,

thank you so much for your time and effort! I appreciate.

At this point, I believe it is only MS Excel to blame for:

On Sat, 2019-10-19 at 18:45 +0200, David Law wrote:
> I think if you check the original XML of your *.xlsx,
> you'll find that it contains something like:
> <v>0.10669129999999999</v>
> 
> This value can be mapped EXACTLY to a double in Java.
> So that's what you're getting.

(Minor objection here: Edit this spreadsheet and multiply the
0.10669129999999999 with 1E15 and you will see that Excel actually uses
0.1066913 internally instead.)

> 
> In other cases you may find XML values like:
> <v>8.6168800000000004E-2</v>
> 

It obviously writes different values like 0.10669129999999999 into the
file then it shown/used for its own calculations (like 0.1066913). I
only wonder how Excel itself knows the difference.
Using LibreOffice fixed the problem immediately. Perhaps newer versions
of MS Excel also fixed that, although I am not even keen to try.

As for the JDBC/database issue, I believe it is a complete different
topic. The definition of VARCHAR(12) is there for a good reason
(because both TEXT and or NUMBER can be written into that field).
Same problem would arise with any other column type when precision was
set to less than 15 digits.

It is actully more like a feature, because the solution was to deliver
the figures as text in the spreadsheet (capturing text '0.1066913 
instead of number 0.1066913).

We can close this case as it is not a POI related challenge.
Thank you again and cheers

Andreas

Reply via email to