[Edge]。→、
新しい Intl.PluralRules オブジェクトを生成して返します。
| locales | 省略可。 言語タグを持つ文字列、またはそのような文字列の配列。→Intl:locales | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| options | 省略可。以下のプロパティと値を 1 組以上持つオブジェクト。
|
プロパティ minimumFractionDigits、maximumFractionDigits、minimumSignificantDigits、maximumSignificantDigits は 2 つのグループに分けられます。
第 2 のグループで 1 つでもプロパティが定義されると、第 1 のグループは無視されます。
DA=new Intl.PluralRules('ja'); //日本語。
D=DA.select(0); //=[string]:other
D=DA.select(1); //=[string]:other
D=DA.select(2); //=[string]:other
DA=new Intl.PluralRules('ja', {type:'ordinal'}); //日本語、種別。
D=DA.select(0); //=[string]:other
D=DA.select(1); //=[string]:other
D=DA.select(2); //=[string]:other
DA=new Intl.PluralRules('en'); //英語。
D=DA.select(0); //=[string]:other
D=DA.select(1); //=[string]:one
D=DA.select(2); //=[string]:other
DA=new Intl.PluralRules('en', {type:'ordinal'}); //英語、種別。
D=DA.select(0); //=[string]:other
D=DA.select(1); //=[string]:one
D=DA.select(2); //=[string]:two
DA=new Intl.PluralRules('ar'); //アラビア語。
D=DA.select(0); //=[string]:zero
D=DA.select(1); //=[string]:one
D=DA.select(2); //=[string]:two
D=DA.select(10); //=[string]:few
D=DA.select(14); //=[string]:many
new Intl.NumberFormat('ar', {maximumSignificantDigits:1});
D=DA.format(14); //=[string]:10
//↑「10」に四捨五入される。
DA=new Intl.PluralRules('ar', {maximumSignificantDigits:1}); //アラビア語、数値の有効桁数:1桁。
D=DA.select(14); //=[string]:few
→select()。