Package Exports
- intl-pluralrules
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (intl-pluralrules) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
intl-pluralrules
A spec-compliant polyfill for Intl.PluralRules. Particularly useful if you
need proper support for minimumFractionDigits
.
Installation
npm install intl-pluralrules
Usage
To use the polyfill, just import it to make sure that a fully functional
Intl.PluralRules
is available in your environment:
import 'intl-pluralrules'
If Intl.PluralRules
already exists and supports
multiple locales, the polyfill will not be
loaded.
The implementation itself is available as
intl-pluralrules/plural-rules
, if you'd prefer using it without modifying your
Intl
object, or if you wish to use it rather than your environment's own:
import PluralRules from 'intl-pluralrules/plural-rules'
new PluralRules('en').select(1) // 'one'
new PluralRules('en', { minimumSignificantDigits: 3 }).select(1) // 'other'