You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spreadsheet number formats always use en-US separators, and a caller cannot tell numeric cells from text #233
When a number format is applied to a spreadsheet cell, the group separator is always , and the decimal separator always . (numfmt.rs#L863, numfmt.rs#L884).
A workbook does not store separators: the spreadsheet application takes them from the viewer's locale. In locales that use the opposite convention (Italian, German, Spanish, Portuguese and others), the Markdown reads differently from what the workbook shows to its own users:
Value
Format
Output
Read with , as decimal separator
5002
#,##0
5,002
five point zero zero two
1250
#,##0 "€"
1,250 €
one euro and twenty-five cents
The module comment already explains why dates stay ISO-like (numfmt.rs#L4-L6): mm/dd versus dd/mm is ambiguous for a downstream reader. Group and decimal separators carry the same ambiguity, and the error is a factor of a thousand.
Why a caller cannot correct it
Cell exposes only blocks, the already formatted text (_anydoc.pyi#L200-L203). A caller cannot tell a numeric cell from a text cell that looks like a number, so swapping separators afterwards would also change text cells that already follow the reader's convention, such as 1.250 entered as text.
Possible fixes
Either would let a caller produce unambiguous output:
Expose on the cell whether it holds a number, with its raw value and its number format code.
An option that chooses the group and decimal separators used when number formats are applied.
Activity