The abstract operation InitializePluralRules accepts the arguments pluralRules (which must be an object), locales, and options. It initializes pluralRules as a PluralRules object. It performs the following steps:
When the GetOperands abstract operation is called with argument s. It performs the following steps:
"."
»).Internal Slot | Type | Description |
---|---|---|
[[Number]] | Number | absolute value of the source number (integer and decimals) |
[[IntegerDigits]] | Number | Number of digits of [[Number]]. |
[[NumberOfFractionDigits]] | Number | Number of visible fraction digits in [[Number]], with trailing zeros. |
[[NumberOfFractionDigitsWithoutTrailing]] | Number | Number of visible fraction digits in [[Number]], without trailing zeros. |
[[FractionDigits]] | Number | Number of visible fractional digits in [[Number]], with trailing zeros. |
[[FractionDigitsWithoutTrailing]] | Number | Number of visible fractional digits in [[Number]], without trailing zeros. |
When the PluralRuleSelection abstract operation is called with four arguments, it performs implementation dependent algorithm to map n to the appropriate plural representation of the Operand
When the ResolvePlural abstract operation is called with arguments pluralRules (which must be an object initialized as a PluralRules) and n (which must be a Number value), it returns a String value representing the plural form of n according to the effective locale and the options of pluralRules.
The following steps are taken:
The PluralRules constructor is a standard built-in property of the Intl object. Behaviour common to all service constructor properties of the Intl object is specified in
When the
The Intl.PluralRules constructor has the following properties:
The value of
This property has the attributes { [[Writable]]:
When the
The value of the
The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in
The value of the [[RelevantExtensionKeys]] internal slot is
The Intl.PluralRules prototype object is itself an ordinary object. %PluralRulesPrototype% is not an Intl.PluralRules instance and does not have an [[InitializedPluralRules]] internal slot or any of the other internal slots of Intl.PluralRules instance objects.
In the following descriptions of functions that are properties or [[Get]] attributes of properties of
The initial value of
The initial value of the @@toStringTag property is the string value
This property has the attributes { [[Writable]]:
When the
This function provides access to the locale and options computed during initialization of the object.
The function returns a new object whose properties and attributes are set as if constructed by an object literal assigning to each of the following properties the value of the corresponding internal slot of this PluralRules object. (see
Intl.PluralRules instances inherit properties from
Intl.PluralRules instances and other objects that have been successfully initialized as a PluralRules have [[InitializedIntlObject]] and [[InitializedPluralRules]] internal slots whose values are
Objects that have been successfully initialized as a PluralRules object also have several internal slots that are computed by the constructor: