keep large ints precise in xls/xlsx export#650
Open
CodingSelim wants to merge 1 commit into
Open
Conversation
35d7339 to
cb6f1f2
Compare
integers past 2**53 don't fit in excel's float64 storage and got mangled (568883383628111872 came out as 568883383628112000). write those as text. closes jazzband#197
cb6f1f2 to
c0c8d0c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #197.
Integers past 2**53 don't fit in Excel's float64 number storage, so they got silently mangled on export — e.g.
568883383628111872came back as568883383628112000.Following @claudep's suggestion on the issue, values with
abs(col) > 2**53are now written as text so the digits survive. Normal-sized ints (and bools) are untouched. Applied to both_xls.pyand_xlsx.py, with a test for each.