Intl.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

Specification Status Comment
Intl Plural Rules Draft Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung InternetNode.js
Basic supportChrome Full support 63Edge No support NoFirefox Full support 58IE No support NoOpera Full support 50Safari No support NoWebView Android Full support 63Chrome Android Full support 63Edge Mobile No support NoFirefox Android Full support 58Opera Android Full support 50Safari iOS No support NoSamsung Internet Android No support Nonodejs No support No

Legend

Full support  
Full support
No support  
No support

See also

Document Tags and Contributors

Contributors to this page: fscholz
Last updated by: fscholz,