Repository navigation
JSE-F4: built-in formats 37-40 and 47 use Excel's codes - #120
Merged
Merged
Conversation
Excel for Mac shows #,##0_);(#,##0), #,##0_);[Red](#,##0), #,##0.00_);(#,##0.00), #,##0.00_);[Red](#,##0.00) and mm:ss.0 for the built-in ids 37, 38, 39, 40 and 47 (conformance check, 2026-11-17). The ECMA-376 table, which BUILTIN_NUM_FMTS followed, lists other codes. - BUILTIN_NUM_FMTS and therefore formatValue/formatCell and the render model use Excel's codes. The writer writes only the id, so files are unchanged. - Corpus 10-number-formats: column B shows Excel's codes. - The LibreOffice known-difference rule for 39/40/47 is gone: LibreOffice already used Excel's codes. - Tests: the codes, the _) padding on positives (1,234.50 + space) and mm:ss.0 (31:00.0, 31:00.5). - docs/api.md 11.2 lists Excel's codes and the ECMA ones for reference.
From the CI LibreOffice job on this branch: 439 probes, 350 identical, 89 different for a known reason, 0 unexplained.
- b: the codes for 37-40 and 47 are the ones copied from Format Cells (37 confirmed exactly, no slip note). Column B held the ECMA codes at the time, so the separate "matched column B" answer is not relied on. - c: no result was reported for the Display sheet; stays not verified. - d: in de-DE, ids 27-36 and 50-58 display as dates; B and C differ with the same pattern (locale separators and date order). East Asian locales were not tried. - h: Excel accepts 30 x's + an emoji (31 code points, 32 UTF-16 units), so the limit counts code points. History was not tried. docs/api.md notes that the writer still counts UTF-16 units, so it is stricter than Excel for such names.
This was referenced Nov 17, 2026
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.
The manual conformance check in Excel for Mac (2026-11-17) recorded the codes Excel shows for the built-in number formats 37–40 and 47. All five differ from the ECMA-376 table that
BUILTIN_NUM_FMTSfollowed, and match what LibreOffice already used:#,##0 ;(#,##0)#,##0_);(#,##0)#,##0 ;[Red](#,##0)#,##0_);[Red](#,##0)#,##0.00;(#,##0.00)#,##0.00_);(#,##0.00)#,##0.00;[Red](#,##0.00)#,##0.00_);[Red](#,##0.00)mmss.0mm:ss.0These are the codes copied from Excel's Format Cells dialog, and they are the record. Column B of the corpus held the ECMA-376 codes at the time, so the separate answer that the codes "matched column B" is not relied on.
What changes
BUILTIN_NUM_FMTS(public export), and thereforeformatValue,formatCelland the render model, for these ids:1,234.50becomes1,234.50(the_)padding).1,234. The ECMA code had a literal space; Excel's has_).(1,234.50).3100.0becomes31:00.0.numFmtIdfor a built-in id and never the code.10-number-formats.xlsx: column B of the Built-in sheet now shows Excel's codes, so the corpus file's bytes change. No other corpus file or golden test changes.test/format/libreoffice.test.ts: the known-difference rulebuiltin-39-40-47is removed, because LibreOffice andformatValuenow agree on those probes. The CI LibreOffice job shows this (no unexplained differences).The other manual-check answers (docs only)
Recorded in
test/conformance/corpus.ts, which regeneratesdocs/conformance.md, and indocs/api.md:x+ 😀 as a sheet name, which is 31 code points and 32 UTF-16 units, so the 31-character limit counts code points: confirmed. Renaming a sheet toHistorywas not tried, so that stays not verified. Note: the writer'svalidateSheetNamecounts UTF-16 units (name.length), so it is stricter than Excel and rejects such a name. That is not changed here.Tests
test/read/helpers.test.ts: the five codes.test/format/format.test.ts:_)padding on 39/40 positives,mm:ss.0(31:00.0 and 31:00.5).Patch changeset (
builtin-codes-excel).