I'm looking for a complete list of all the different Intl.NumberFormats.
The Intl.NumberFormat page shows 3 different formats.
ja-JP -> "¥123,457"
de-DE -> 123.456,79 €
en-IN -> 1,23,000
Is this all? Or is there more?
Intl.NumberFormat.prototype.format() Getter function that formats a number according to the locale and formatting options of this Intl.NumberFormat object. Intl.NumberFormat.prototype.formatToParts() Returns an Array of objects representing the number string in parts that can be used for custom locale-aware formatting.
NumberFormat is the abstract base class for all number formats. This class provides the interface for formatting and parsing numbers. NumberFormat also provides methods for determining which locales have number formats, and what their names are. NumberFormat helps you to format and parse numbers for any locale.
maximumSignificantDigits. The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
The Intl object is the namespace for the ECMAScript Internationalization API, which provides language sensitive string comparison, number formatting, and date and time formatting.
Intl was introduced here https://hacks.mozilla.org/2014/12/introducing-the-javascript-internationalization-api/ with these takeaways:
tl;dr: So if you send in your best guess at a valid locale, the best fit algorithm will get you something usable!
Valid locale?
According to the documentation and my earlier research, the Intl
javascript API expects you to format your locale codes according to BCP 47.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With