Skip to content

fix(xlsx): preserve full float precision instead of scientific notation - #2717

Open
Wali Reheman (wali-reheman) wants to merge 1 commit into
microsoft:mainfrom
wali-reheman:fix/upstream-xlsx-float-precision
Open

Wali Reheman (wali-reheman) wants to merge 1 commit into
microsoft:mainfrom
wali-reheman:fix/upstream-xlsx-float-precision

Conversation

@wali-reheman

@wali-reheman Wali Reheman (wali-reheman) commented Oct 19, 2026 •

Copy link
Copy Markdown

pandas DataFrame.to_html defaults to 6-digit scientific notation, which loses precision for values like 123456789.123. This passes float_format=lambda x: str(x) to both to_html() calls in the XLSX and XLS converters, preserving the full Python round-trip string representation.

  • Both XlsxConverter and XlsConverter updated
  • Regression test added (test_float_precision_preserved)
  • Rebased onto current main

Refs: #2532

@wali-reheman

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@wali-reheman
Wali Reheman (wali-reheman) force-pushed the fix/upstream-xlsx-float-precision branch 3 times, most recently from 1900506 to 0d4e02c Compare October 22, 2026 23:13
@wali-reheman
Wali Reheman (wali-reheman) force-pushed the fix/upstream-xlsx-float-precision branch from 0d4e02c to cbbb966 Compare November 15, 2026 14:05
Pass float_format=lambda x: str(x) to DataFrame.to_html() calls in both
XLSX and XLS converters so that float values like 123456789.123 are
rendered as-is instead of being truncated to 1.234568e+05.

Refs: microsoft#2532
@wali-reheman
Wali Reheman (wali-reheman) force-pushed the fix/upstream-xlsx-float-precision branch from cbbb966 to d4cff84 Compare December 2, 2026 14:06
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.

1 participant