Skip to content
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

Numbering system option value not correctly passed to internal Intl.NumberFormat instances #819

Closed
anba opened this issue Aug 4, 2023 · 0 comments · Fixed by #919
Closed
Labels
bug c: numbers Component: numbers, currency, units s: help wanted Status: help wanted; needs proposal champion Small Smaller change solvable in a Pull Request
Milestone

Comments

@anba
Copy link
Contributor

anba commented Aug 4, 2023

new Intl.RelativeTimeFormat("en", {numberingSystem:"hanidec"}).format(2, "days") is currently spec'ed to return the string "in 2 days" instead of "in 二 days".

new Intl.RelativeTimeFormat("en-u-nu-hanidec").format(2, "days") is correctly spec'ed to return "in 二 days", though.

InitializeRelativeTimeFormat

  1. Let relativeTimeFormat.[[NumberFormat]] be ! Construct(%NumberFormat%, « locale »).

Should instead be:

  1. Let nfOptions be OrdinaryObjectCreate(null).
  2. Perform ! CreateDataPropertyOrThrow(nfOptions, "numberingSystem", relativeTimeFormat.[[NumberingSystem]]).
  3. Let relativeTimeFormat.[[NumberFormat]] be ! Construct(%NumberFormat%, « locale, nfOptions »).

Also applies to the Intl.NumberFormat instances in FormatDateTimePattern.

@sffc sffc added bug editorial Involves an editorial fix c: numbers Component: numbers, currency, units s: help wanted Status: help wanted; needs proposal champion Small Smaller change solvable in a Pull Request and removed editorial Involves an editorial fix labels Dec 14, 2023
@sffc sffc added this to the ES 2024 milestone Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: numbers Component: numbers, currency, units s: help wanted Status: help wanted; needs proposal champion Small Smaller change solvable in a Pull Request
Projects
None yet
2 participants