Intl.PluralRules.selectRange()
Intl.PluralRules.prototype.selectRange()
メソッドは 2 つの値を受け取り、ロケールを考慮した書式設定に使用する複数形ルールを示す文字列を返します。
構文
js
selectRange(startRange, endRange);
返値
数字の複数形のカテゴリーを表す文字列で、 zero
, one
, two
, few
, many
, other
のいずれかで、 LDML 言語複数ルールで指定されたローカライズのロケールに関連するものです。
解説
この関数は、 Intl.PluralRules
オブジェクトのロケールおよび書式化オプションに従って、複数形カテゴリーを選択するものです。
例
selectRange() の使用
js
new Intl.PluralRules("sl").selectRange(102, 201);
// → 'few'
new Intl.PluralRules("pt").selectRange(102, 102);
// → 'other'
仕様書
Specification |
---|
ECMAScript® 2025 Internationalization API Specification # sec-intl.pluralrules.prototype.selectrange |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
selectRange |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.