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

javascript.builtins.Intl.NumberFormat.NumberFormat - options.numberingSystem support listed incorrectly #23122

Open
EdgarPl opened this issue May 17, 2024 · 3 comments
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript

Comments

@EdgarPl
Copy link

EdgarPl commented May 17, 2024

What type of issue is this?

Incorrect support data (example: BrowserX says "86" but support was added in "40")

What information was incorrect, unhelpful, or incomplete?

options.numberingSystem parameter listed as having full support on desktop Firefox 29

What browsers does this problem apply to, if applicable?

Firefox

What did you expect to see?

The option is supported starting Firefox 76

Did you test this? If so, how?

Tested with "ar-EG" and "ar" locales

  1. on Windows Firefox 75:
    Screenshot 2024-05-17 142011
  2. working as expected on FF 76 Mac in browserstack

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

No response

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat

MDN metadata

MDN page report details
  • Query: javascript.builtins.Intl.NumberFormat.NumberFormat
  • Report started: 2024-05-17T11:02:20.364Z
@queengooborg queengooborg added data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript and removed data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API labels May 17, 2024
@EdgarPl EdgarPl changed the title javascript.builtins.Intl.NumberFormat.NumberFormat - options.numberingSystem parameter support listen incorrectly javascript.builtins.Intl.NumberFormat.NumberFormat - options.numberingSystem support listed incorrectly May 20, 2024
@Josh-Cena
Copy link
Member

There are two things wrong here:

  1. numberingSystem should be an option of the constructor, not an option of format.
  2. The only way to test whether Intl supports an option is to query resolvedOptions. Otherwise, the output may simply be due to lack of data.

Here's the output:

image

Therefore Firefox 75 does support numberingSystem. It's just that ar-EG data did not have the nu-latn combination.

@EdgarPl
Copy link
Author

EdgarPl commented Jun 12, 2024

  1. My apologies, I've corrected the screenshot in testing steps to match the actual steps used.
  2. I see, that makes sense. Is there any way to detect which numberingSystems are supported beyond checking the resolved options after trying to apply them?
    Locale accessor numberingSystems returns ["arab"] on browsers that resolve the numberingSystem: "latn" option which seems to me like it contradicts the notes here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#numberingsystem
    Win/Chrome 125:
    Screenshot 2024-06-12 160604

@Josh-Cena
Copy link
Member

Josh-Cena commented Jun 12, 2024

@EdgarPl

Locale#numberingSystems returns the list of numbering systems that are commonly used in the locale. It doesn't necessarily mean the formatter only supports using those particular combinations (I could be wrong but that's my interpretation). When the doc says "For a list of supported numbering system types" it means to refer to the complete table for all values that are considered valid.

Is there any way to detect which numberingSystems are supported beyond checking the resolved options after trying to apply them?

I'm not sure either, as I'm not an expert on the CLDR data format. In fact, I believe it may be a non-issue in the latest browser version, because the data uses templates that gets filled in with any numbering system you want. For example, ar-EG with the hanidec (Positional decimal system using Chinese number ideographs as digits) numbering system is an obviously nonsensical combination, but Chrome formats it anyway:

new Intl.NumberFormat("ar-EG", { numberingSystem: "hanidec" }).format(1234)
// 一,二三四

resolvedOptions also doesn't indicate whether data is available. You may specify a non-sensical combination that doesn't have data, which will cause fallback when calling format, but this fallback won't be reflected by any other means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript
Projects
None yet
Development

No branches or pull requests

3 participants