-
Notifications
You must be signed in to change notification settings - Fork 14
Add [[PluralRules]] internal slot like Intl.RelativeTimeFormat #86
Comments
When scientific or compact notation is used, the whole number should be considered in Intl.PluralRules. For example, "1K" should get the plural form of 1000. A few locales have special rules for such numbers, which is being addressed in ICU-13836. The behavior "1.00 British pounds" is correct. You get that out of Intl.PluralRules if you pass in the correct option: new Intl.PluralRules('en', { minimumFractionDigits: 2 }).select(1)
// "other" I'll need to check the spec for what the behavior is supposed to be when you pass the currency options bag to Intl.PluralRules. |
Thanks that fixes it! What's your thought on introducing an internal |
That's a good idea. This would be a larger change than I'm interested in doing with Unified NumberFormat currently, because we already have significant changes from Stage 3. I'll label this as "future" and we can do a follow-on Editorial PR to clean this up and make the behavior less ambiguous. |
Cool sgtm! |
Another question: new Intl.NumberFormat('en', {
style: 'currency',
currency: 'ZWD',
currencyDisplay: 'name',
notation: 'scientific'
}).format(10000)
// '1E4 Zimbabwean dollar (1980–2008)' instead of |
That's an ICU bug being addressed in https://unicode-org.atlassian.net/browse/ICU-13836 (the bug says "compact notation", but it also applies to scientific notation). Here is the PR to fix it: unicode-org/icu#938 |
Upstream issue for potential remaining work items on this issue: |
I'm confused by some of the results so looking for guidance. E.g:
I would expect it to be
1 British pound
especially sincenew Intl.PluralRules('en').select('1.00')
yieldsone
.The other confusion is around
scientific
notation and whether the plural rules should use the whole number or the mantissa.Thanks!
The text was updated successfully, but these errors were encountered: