Incorrect values when parsing certain formulas exported from excel #372
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#372
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm using js-xlsx to parse xlsx sheets containing time data for a website. Occasionally, the time data comes out wrong. In the particular case I am seeing, the formula calculates 72:00:00 in excel, but when I import it, it gets calculated as 48:00:00. However, if I open the sheet in libreoffice and save it, it will import correctly. Looking at the raw data for the two different sheets, it appears the the value it's giving me for the one saved in excel is 2.9999999996 (thereabouts), while the one it's giving me from libreoffice is just 3. I assume those values mean days, and that it's rounding the 2.9999999996 value down to 2 days, hence 48 hours. There seem to be fairly specific conditions to cause this to happen, and I've attached an example sheet where this happens. If you change the values too much (but if they still add up to 72 hours) it will sometimes actually work, sometimes not, which makes this feel like a floating point precision problem in excel.
Again, sheet is attached. You can test the problem by uploading the sheet to http://oss.sheetjs.com/js-xlsx and just checking the last value.
broken_numbers.xlsx
Thanks @HuFlungDu !
So the issue boiled down to an incomplete propagation of a rounding, which was fixed in SSF 0.9.3 and will be rolled into the next release.
This issue was not completely fixed. It appears the commit to update to ssf 0.9.3 in package.json exists, but the actual distribution code still uses 0.9.2, so if you go to test the sheet I attached at the js-xlsx test site, you'll still see the problem.
Thanks for working to get this fixed!
@HuFlungDu we're going to cut the next version soon, a few other things were messed up in this release too (somehow added the typescript reference in the package.json but didn't include the actual definitions in the npm module).
To confirm that we actually addressed the issue in the underlying module, http://oss.sheetjs.com/ssf/ shows:
Thanks. I assumed it actually got fixed, just figured I should let you know I saw that issue. I'll test the next release once it gets released and hopefully be able to roll it out to my site shortly thereafter.
Thanks again.
Ok this time I checked :)
It'll show up in NPM once the CI tests pass.
Let us know about any other issues you come across! These reports help a lot
Yep, this release works great! The only issue now is that it does not appear that a 0.10.3 tag was created on the repo, so I can't add the new version to my bower file unless I use the commit id.
good catch! the tag is visible locally but wasn't pushed, give it a few moments to propagate.
Alright, rolled out and working great. Thanks again for the support.