--- title: Intl.PluralRules.select() slug: Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/select tags: - Internationalization - Intl - JavaScript - Method - PluralRules - メソッド - 国際化 translation_of: Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/select ---
Intl.PluralRules.prototype.select
メソッドは、ロケールを考慮した書式設定に使用する複数形ルールを示す String を返します。
pluralCategory = pluralRule.select(number)
number
数字の複数形のカテゴリを表す string
で、 zero
, one
, two
, few
, many
, other
のいずれかになります。
この関数は、 {{jsxref("PluralRules")}} オブジェクトのロケールや書式オプションに応じて、複数形のカテゴリを選択します。
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'
仕様書 |
---|
{{SpecName('ES Int Draft', '#sec-intl.pluralrules.prototype.select', 'Intl.PluralRules.select()')}} |
{{Compat("javascript.builtins.Intl.PluralRules.select")}}