Repository navigation
Use the plural pattern for exact millions in compact formats - #1454
jayhemnani9910 wants to merge 1 commit into
Conversation
French only has an exact-one pattern for 1000, so 1000000 skipped its
plural lookup and fell back to the "other" pattern ("1 millions").
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1454 +/- ##
=======================================
Coverage 93.67% 93.67%
=======================================
Files 27 27
Lines 4983 4983
=======================================
Hits 4668 4668
Misses 315 315
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
akx
left a comment
There was a problem hiding this comment.
Did you check this against other implementations? Feels odd we'd need this special case.
|
I checked this against Node 22.23.4 / ICU 78.3. With The CLDR 49 French data also supports keeping the normal plural when the exact-one pattern is absent at that magnitude: There is an interaction with #1430 worth covering. On its current head I ran 16 direct regression cases: A separate 100-case comparison across ten locales matched Node for all 100 with the combination. This is a bounded sample, not a claim about every locale or value. Babel used CLDR 49; Node reports CLDR 48.0. The original two number-test modules pass on #1454 (142 tests). On #1430 with the newer CLDR data, the same three currency-test failures occur before and after adding the guard, so I am not claiming a clean full suite. Sharing the results for the existing PRs, not opening a competing patch. Investigation and tests were AI-assisted. CLDR data: https://raw.githubusercontent.com/unicode-org/cldr/release-49/common/main/fr.xml |
format_compact_decimal(1000000, format_type="long", locale="fr")returned1 millions. Same for1 milliardsand1 billions, in everyfrlocale.French has an exact-one pattern only for 1000 ("mille"). For other magnitudes, the check picked the
"1"form, found no entry, and fell back to"other"instead of the plural the number has. The"1"form is now used only when it has an entry for that magnitude.Ran every locale for 1K, 1M, 1B and 1T, long and short, before and after: only the
frlong forms change. The new assertion fails before the change. Full test suite passes.