--- title: Intl.NumberFormat.prototype.resolvedOptions() slug: Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/resolvedOptions tags: - Internationalization - JavaScript - Method - NumberFormat - Prototype translation_of: Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/resolvedOptions ---
Intl.NumberFormat.prototype.resolvedOptions() メソッドは、この {{jsxref("NumberFormat")}} オブジェクトの初期化時に計算されたロケールと数値整形オプションを反映したプロパティを持つ新しいオブジェクトを返します。
numberFormat.resolvedOptions()
この {{jsxref("NumberFormat")}} オブジェクトの初期化時に計算されたロケールと数値整形オプションを反映したプロパティを持つ新しいオブジェクトです。
返されるオブジェクトには以下のプロパティがあります。
localelocale に含まれます。numberingSystemoptions 引数でこのプロパティに指定された値、または Unicode 拡張キーの "nu" を使って要求された値、または既定として設定される値です。notationoptions 引数でこのプロパティに指定された値、または既定として設定される standard です。compactDisplayoptions 引数でこのプロパティに指定された値、または既定として設定される short です。notation が "compact" に設定されている場合のみ存在します。signDisplayoptions 引数でこのプロパティに指定された値、または既定として設定される auto です。useGroupingoptions 引数でこのプロパティに指定された値、または既定として設定される値。currencycurrencyDisplayoptions 引数でこのプロパティに指定された値、または既定として設定される値。styleが"currency"の場合のみ、これらのプロパティは存在しています。次の2つのプロパティのグループのうちどちらかのみが含まれています。:
minimumIntegerDigitsminimumFractionDigitsmaximumFractionDigitsoptions 引数でプロパティに対して提供されるか既定で設定される値。 minimumSignificantDigits または maximumSignificantDigits が options 引数で提供されなかった場合のみ、これらのプロパティは存在しています。minimumSignificantDigitsmaximumSignificantDigitsoptions引数でプロパティに対して提供されるかデフォルトとして設定される値。 これらのプロパティのうち少なくとも1つがoptions引数で提供された場合のみ、これらのプロパティは存在しています。var de = new Intl.NumberFormat('de-DE');
var usedOptions = de.resolvedOptions();
usedOptions.locale; // "de-DE"
usedOptions.numberingSystem; // "latn"
usedOptions.notation; // "standard"
usedOptions.signDisplay; // "auto"
usedOption.style; // "decimal"
usedOptions.minimumIntegerDigits; // 1
usedOptions.minimumFractionDigits; // 0
usedOptions.maximumFractionDigits; // 3
usedOptions.useGrouping; // true
| 仕様書 |
|---|
| {{SpecName('ES Int Draft', '#sec-intl.numberformat.prototype.resolvedoptions', 'Intl.NumberFormat.prototype.resolvedOptions')}} |
{{Compat("javascript.builtins.Intl.NumberFormat.resolvedOptions")}}