pluralRules.select
The Intl.PluralRules.prototype.select
method returns a String indicating which plural rule to use for locale-aware formatting.
Syntax
pluralRule.select(number)
Parameters
number
- The number to get a plural rule for.
Description
This function selects a plural rule according to the locale and formatting options of a PluralRules
object.
Examples
Using select
new Intl.PluralRules('ar-EG').select(0);
// → 'zero'
new Intl.PluralRules('ar-EG').select(1);
// → 'one'
new Intl.PluralRules('ar-EG').select(2);
// → 'two'
new Intl.PluralRules('ar-EG').select(6);
// → 'few'
new Intl.PluralRules('ar-EG').select(18);
// → 'many'
Specifications
|
Desktop |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
Basic support |
63 |
No |
58 |
No |
50 |
No |
|
Mobile |
|
Android webview |
Chrome for Android |
Edge Mobile |
Firefox for Android |
Opera for Android |
iOS Safari |
Samsung Internet |
Basic support |
63 |
63 |
No |
58 |
50 |
No |
No |
|
Server |
|
Node.js |
Basic support |
No |
See also