This package requires the following capabilities:
Everything in the ES2020 Internationalization API spec (https://tc39.es/ecma402).
You can use polyfill.io URL Builder to create a polyfill script tag for
Intl.NumberFormat. By default the created URL does not come with any locale data. In order to add locale data, append
Intl.NumberFormat.~locale.<locale>, as well as locale data for any required polyfills, to your list of features. For example:
Intl.PluralRules needs to be polyfilled as well:
Currently, the spec defines a list of sanctioned units as below.
You can specify
X-per-Y unit, where
Y are sanctioned simple units (e.g.
The library will choose the best-fit localized pattern to format this compound unit.