Skip to content

keep large ints precise in xls/xlsx export#650

Open
CodingSelim wants to merge 1 commit into
jazzband:masterfrom
CodingSelim:fix-large-int-excel
Open

keep large ints precise in xls/xlsx export#650
CodingSelim wants to merge 1 commit into
jazzband:masterfrom
CodingSelim:fix-large-int-excel

Conversation

@CodingSelim

Copy link
Copy Markdown

Fixes #197.

Integers past 2**53 don't fit in Excel's float64 number storage, so they got silently mangled on export — e.g. 568883383628111872 came back as 568883383628112000.

Following @claudep's suggestion on the issue, values with abs(col) > 2**53 are now written as text so the digits survive. Normal-sized ints (and bools) are untouched. Applied to both _xls.py and _xlsx.py, with a test for each.

@CodingSelim CodingSelim force-pushed the fix-large-int-excel branch from 35d7339 to cb6f1f2 Compare July 4, 2026 02:48
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
@CodingSelim CodingSelim force-pushed the fix-large-int-excel branch from cb6f1f2 to c0c8d0c Compare July 4, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong long int value exported

1 participant