Bug 60801 - Some long numbers are wrong when use POI
Summary: Some long numbers are wrong when use POI
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-02 10:26 UTC by Max
Modified: 2017-03-02 11:32 UTC (History)
1 user (show)



Attachments
test excel file (11.88 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2017-03-02 10:56 UTC, Max
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max 2017-03-02 10:26:25 UTC

    
Comment 1 Max 2017-03-02 10:35:07 UTC
I have found the wrong work of readLongLE() method in DataInputBlock.class.
If we have, for example numbers like in our excel sheet:

90003097950700100
90003147950700100
90005037950200100
90005037950200200
90005037950200300

In POI in will be:

90003097950700096
90003147950700096
90005037950200096
90005037950200192
90005037950200304

after transformation.
Comment 2 Nick Burch 2017-03-02 10:51:00 UTC
Are you sure this isn't just a lack of precision in the number due to insufficient bits available to store the exact value? (Most commonly also seen by people storing credit card numbers in an excel cell formatted as a number)
Comment 3 Max 2017-03-02 10:56:20 UTC
Created attachment 34794 [details]
test excel file

There aare some numbers in that text file. Some of them have string cell format and some of them - format like digits. Some of the numbers formatted like digits have wrong  representation in poi.
Comment 4 Max 2017-03-02 11:02:02 UTC
Hello, Nick. Maybe you are right. It's really big numbers that supposed to be strings. But some of them nevertheless correct treated by POI. I have attached the file with example.
Comment 5 Nick Burch 2017-03-02 11:26:58 UTC
Ping David North, our expert on this sort of thing...
Comment 6 Max 2017-03-02 11:32:57 UTC
Ok, thank you, Nick!