-
Notifications
You must be signed in to change notification settings - Fork 106
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
Change Array.prototype.toLocaleString to use ListFormat #422
Comments
Two potential issues which can make the transition to
for (let locale of ["en", "de", "fr"]) {
for (let type of ["conjunction", "unit"]) {
for (let style of ["long", "short", "narrow"]) {
print(`${locale} (${type}-${style}):`, new Intl.ListFormat(locale, {type, style}).format(["1", "2"]))
}
}
}
|
This is a great question that I don't have an immediate answer to. One possible solution: namespace the child options like so: [1].toLocaleString("en", {
numberOptions: {
style: "percent"
}
});
Right; this would be a normative change that we would just need to make sure everyone can agree to. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Good catch, @FrankYFTang . I agree this should be addressed. Some ideas about the issues @anba raised:
|
How about this?
currently, in Chrome we got so the above is equlivent to
the above right now in Chrome output 'October 9, 2021, NT$1,234.00, NT$567.00, & October 9, 2021' and we construct a listOption as {type: type, style: listStyle} to pass to ListFormat? |
We discuss this in TG2 today (2021-11-04). I feel it might be an issue much more complicated than I expected and would like to park this issue and let other drive it they feel interest. People can still use Intl.ListFormat to do what they like to do and I think the possibility option conclit between different types of items is way too complicated and probably a good idea to just keep the status quo. |
Maybe we should consider just deprecating Array.prototype.toLocaleString.
|
I think we have a general agreement that the output of |
Currently, there is a section in ECMA402 about Array.prototype.toLocaleString
https://ecma-international.org/ecma-402/#sup-array.prototype.tolocalestring
With the newly Stage 3 Intl.ListFormat moving to Stage 4, we should consider to rewrite that section to delegate the behavior to Intl.ListFormat
The text was updated successfully, but these errors were encountered: