Description
XLSX/XLS conversion renders spreadsheet float values through pandas' to_html default, which formats floats with 6 significant digits in scientific notation. Entered values lose digits:
123456789.123 becomes 1.234568e+08 (the fractional part is gone)
0.1 becomes 1.000000e-01
42 in a float column becomes 4.200000e+01
Distinct from #53 (currency display formatting) and #2516 (blank-cell column upcasting): this happens in a clean all-float column with no blanks and no currency formats; the raw stored value itself is what gets mangled.
Reproduction
import io
from openpyxl import Workbook
from markitdown import MarkItDown, StreamInfo
wb = Workbook(); ws = wb.active
ws["A1"] = "money"; ws["A2"] = 123456789.123; ws["A3"] = 0.1
buf = io.BytesIO(); wb.save(buf); buf.seek(0)
print(MarkItDown().convert_stream(buf, stream_info=StreamInfo(extension=".xlsx")).markdown)
Expected behavior
The shortest string that round-trips the stored value: 123456789.123, 0.1, 1e-10.
Environment
markitdown main (945314a)
Description
XLSX/XLS conversion renders spreadsheet float values through pandas'
to_htmldefault, which formats floats with 6 significant digits in scientific notation. Entered values lose digits:123456789.123becomes1.234568e+08(the fractional part is gone)0.1becomes1.000000e-0142in a float column becomes4.200000e+01Distinct from #53 (currency display formatting) and #2516 (blank-cell column upcasting): this happens in a clean all-float column with no blanks and no currency formats; the raw stored value itself is what gets mangled.
Reproduction
Expected behavior
The shortest string that round-trips the stored value:
123456789.123,0.1,1e-10.Environment
markitdown main (
945314a)