-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What grouping strategies to include? #3
Comments
I assume |
Correct
It's not clear whether having that option in ICU is good i18n practices. The use cases for turning grouping on and off are known, but it's not clear what the use cases are of overriding the grouping sizes themselves with Western defaults. |
Would
@sffc You mention a possible Western bias with the possible "thousands" option. Can you say anything more about how/whether non-Western locales tend to handle this sort of case? |
I chatted with @ryzokuken ; sounds like the answer is "no". |
I think the "additional options" I was thinking of, were basically targeting the "min2" case, so I think min2 may cover it. I'm thinking of patterns I'd seen in CLDR for more specialization, but at least the ones I saw were dealing with the min2 case. |
Just FYI Peter Edberg [email protected] point out to me about Spanish locale using min2: REAL ACADEMIA ESPAÑOLA (Spanish language authority) specifies that numbers in the range 1000-9999 should not have a thousands separator, see section 2a) in the following: |
Note, @sffc clarified in the April 2020 ECMA-402 call that |
Maybe the setting should be "minimum number of digits to start grouping". |
@ray007 Do you have a use case for where 4 or 5 is not the answer? |
Hello, I am trying to understand if the proposed I work in es-CL and es-MX. I would like to use example: Intl.NumberFormat('es-CL', { style: 'currency', currency: 'CLP' }).format(1000)
# result: $1000, this is bad because there is no thousands separator
Intl.NumberFormat('es-CL', { style: 'currency', currency: 'CLP' }).format(10000)
# result: $10.000, this is good As you can see, I get the correct unit grouping on a 5 digit number, but not on a 4 digit number. The reason for this is that these locales inherit from es, which is defined by Unicode more or less in accordance with the Spanish Royal Academy. The Academy mentions that 4-digit numbers should not use unit separators. This is not really correct in Latin America (or Spain as far as I know), which means that I cannot use So in summary, can I force a unit separation in a currency formatter even if the minimum grouping number defined in the locale has not been reached? |
For what it's worth, I'm hoping my specific grouping issue will be solved in the next Unicode CLDR update. Regardless, I also think that giving more grouping options to end users will make the internationalization functions more useful, and being able to override locale defaults is an important part of this. |
I would like to seek consensus on the following:
|
TG2 2020-10-08: Adopt the behavior stated above, with resolvedOptions returning |
The proposal currently includes the following 4 grouping strategies, based on the list from ICU:
"never"
(false
): do not display grouping separators."min2"
: display grouping separators when there are at least 2 digits in a group; for example, "1000" (first group too small) and "10,000" (now there are at least 2 digits in that group)."auto"
(default): display grouping separators based on the locale preference, which may also be dependent on the currency. Most locales prefer to use grouping separators."always"
(true
): display grouping separators even if the locale prefers otherwise.@jswalden asked if there could be additional options added. Could you clarify?
The text was updated successfully, but these errors were encountered: