Intl.PluralRules.prototype.resolvedOptions()
method returns a new object with properties reflecting the locale and plural formatting options computed during initialization of this
PluralRules
对象。
pluralRule.resolvedOptions()
A new object with properties reflecting the locale and plural formatting options computed during the initialization of the given
PluralRules
对象。
The resulting object has the following properties:
locale
locale
.
pluralCategories
Array
of plural categories used by the given locale, seleced from the list
"zero"
,
"one"
,
"two"
,
"few"
,
"many"
and
"other"
.
type
cardinal
or
ordinal
).
Only one of the following two groups of properties is included:
minimumIntegerDigits
minimumFractionDigits
maximumFractionDigits
options
argument or filled in as defaults. These properties are present only if neither
minimumSignificantDigits
nor
maximumSignificantDigits
was provided in the
options
自变量。
minimumSignificantDigits
maximumSignificantDigits
options
argument or filled in as defaults. These properties are present only if at least one of them was provided in the
options
自变量。
resolvedOptions
方法
var de = new Intl.PluralRules('de-DE');
var usedOptions = de.resolvedOptions();
usedOptions.locale; // "de-DE"
usedOptions.maximumFractionDigits; // 3
usedOptions.minimumFractionDigits; // 0
usedOptions.minimumIntegerDigits; // 1
usedOptions.pluralCategories; // Array [ "one", "other" ]
usedOptions.type; // "cardinal"
| 规范 |
|---|
|
ECMAScript 国际化 API (ECMA-402)
The definition of 'Intl.PluralRules.prototype.resolvedOptions' in that specification. |
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resolvedOptions
|
Chrome 63 | Edge 18 | Firefox 58 | IE No | Opera 50 | Safari 13 | WebView Android 63 | Chrome Android 63 | Firefox Android 58 | Opera Android 46 | Safari iOS 13 | Samsung Internet Android 8.0 |
nodejs
10.0.0
|
完整支持
不支持
见实现注意事项。
Intl
Collator
DateTimeFormat
ListFormat
NumberFormat
PluralRules
RelativeTimeFormat
Object
Object.prototype.__defineGetter__()
Object.prototype.__defineSetter__()
Object.prototype.__lookupGetter__()
Object.prototype.__lookupSetter__()
Object.prototype.hasOwnProperty()
Object.prototype.isPrototypeOf()
Object.prototype.propertyIsEnumerable()
Object.prototype.toLocaleString()
Object.prototype.toSource()
Object.prototype.toString()
Object.prototype.valueOf()
Object.setPrototypeOf()