diff --git a/spec/numberformat.html b/spec/numberformat.html index c2492299..c13c50ed 100644 --- a/spec/numberformat.html +++ b/spec/numberformat.html @@ -17,7 +17,7 @@

Intl.NumberFormat ( [ _locales_ [ , _options_ ] ] )

1. If NewTarget is *undefined*, let _newTarget_ be the active function object, else let _newTarget_ be NewTarget. - 1. Let _numberFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%NumberFormat.prototype%"*, « [[InitializedNumberFormat]], [[Locale]], [[DataLocale]], [[NumberingSystem]], [[Style]], [[Unit]], [[UnitDisplay]], [[Currency]], [[CurrencyDisplay]], [[CurrencySign]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[RoundingType]], [[Notation]], [[CompactDisplay]], [[UseGrouping]], [[SignDisplay]], [[RoundingMode]], [[RoundingIncrement]], [[ComputedRoundingPriority]], [[TrailingZeroDisplay]], [[BoundFormat]] »). + 1. Let _numberFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%NumberFormat.prototype%"*, « [[InitializedNumberFormat]], [[Locale]], [[DataLocale]], [[NumberingSystem]], [[Style]], [[Unit]], [[UnitDisplay]], [[Currency]], [[CurrencyDisplay]], [[CurrencySign]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[RoundingType]], [[Notation]], [[CompactDisplay]], [[UseGrouping]], [[SignDisplay]], [[RoundingIncrement]], [[RoundingMode]], [[ComputedRoundingPriority]], [[TrailingZeroDisplay]], [[BoundFormat]] »). 1. Perform ? InitializeNumberFormat(_numberFormat_, _locales_, _options_). 1. If the implementation supports the normative optional constructor mode of , then 1. Let _this_ be the *this* value. @@ -113,10 +113,10 @@

1. Let _mnsd_ be ? Get(_options_, *"minimumSignificantDigits"*). 1. Let _mxsd_ be ? Get(_options_, *"maximumSignificantDigits"*). 1. Set _intlObj_.[[MinimumIntegerDigits]] to _mnid_. - 1. Let _roundingPriority_ be ? GetOption(_options_, *"roundingPriority"*, ~string~, « *"auto"*, *"morePrecision"*, *"lessPrecision"* », *"auto"*). 1. Let _roundingIncrement_ be ? GetNumberOption(_options_, *"roundingIncrement"*, 1, 5000, 1). 1. If _roundingIncrement_ is not in « 1, 2, 5, 10, 20, 25, 50, 100, 200, 250, 500, 1000, 2000, 2500, 5000 », throw a *RangeError* exception. 1. Let _roundingMode_ be ? GetOption(_options_, *"roundingMode"*, ~string~, « *"ceil"*, *"floor"*, *"expand"*, *"trunc"*, *"halfCeil"*, *"halfFloor"*, *"halfExpand"*, *"halfTrunc"*, *"halfEven"* », *"halfExpand"*). + 1. Let _roundingPriority_ be ? GetOption(_options_, *"roundingPriority"*, ~string~, « *"auto"*, *"morePrecision"*, *"lessPrecision"* », *"auto"*). 1. Let _trailingZeroDisplay_ be ? GetOption(_options_, *"trailingZeroDisplay"*, ~string~, « *"auto"*, *"stripIfInteger"* », *"auto"*). 1. NOTE: All fields required by SetNumberFormatDigitOptions have now been read from _options_. The remainder of this AO interprets the options and may throw exceptions. 1. If _roundingIncrement_ is not 1, set _mxfdDefault_ to _mnfdDefault_. @@ -490,14 +490,14 @@

Intl.NumberFormat.prototype.resolvedOptions ( )

[[SignDisplay]] *"signDisplay"* - - [[RoundingMode]] - *"roundingMode"* - [[RoundingIncrement]] *"roundingIncrement"* + + [[RoundingMode]] + *"roundingMode"* + [[ComputedRoundingPriority]] *"roundingPriority"* @@ -547,8 +547,9 @@

Properties of Intl.NumberFormat Instances

[[SignDisplay]] is one of the String values *"auto"*, *"always"*, *"never"*, *"exceptZero"*, or *"negative"*, specifying when to include a sign (with non-*"auto"* options respectively corresponding with inclusion always, never, only for non-zero numbers, or only for non-zero negative numbers). In scientific notation, this slot affects the sign display of the mantissa but not the exponent. -
  • [[RoundingMode]] is one of the String values in the Identifier column of , specifying which rounding mode to use.
  • [[RoundingIncrement]] is an integer-valued Number that evenly divides 10, 100, 1000, or 10000 into tenths, fifths, quarters, or halves. It indicates the increment at which rounding should take place relative to the calculated rounding magnitude. For example, if [[MaximumFractionDigits]] is 2 and [[RoundingIncrement]] is 5, then the number is rounded to the nearest 0.05 ("nickel rounding").
  • +
  • [[RoundingMode]] is one of the String values in the Identifier column of , specifying which rounding mode to use.
  • +
  • [[ComputedRoundingPriority]] is one of the String values *"auto"*, *"lessPrecision"*, or *"morePrecision"*, specifying the strategy to resolve mixed fraction digits and significant digits settings.
  • [[TrailingZeroDisplay]] is one of the String values *"auto"* or *"stripIfInteger"*, indicating whether to strip trailing zeros if the formatted number is an integer (i.e., has no non-zero fraction digit).
  • diff --git a/spec/pluralrules.html b/spec/pluralrules.html index 0acd9c20..a569f34f 100644 --- a/spec/pluralrules.html +++ b/spec/pluralrules.html @@ -17,7 +17,7 @@

    Intl.PluralRules ( [ _locales_ [ , _options_ ] ] )

    1. If NewTarget is *undefined*, throw a *TypeError* exception. - 1. Let _pluralRules_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%PluralRules.prototype%"*, « [[InitializedPluralRules]], [[Locale]], [[Type]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[RoundingType]], [[RoundingMode]], [[RoundingIncrement]], [[TrailingZeroDisplay]] »). + 1. Let _pluralRules_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%PluralRules.prototype%"*, « [[InitializedPluralRules]], [[Locale]], [[Type]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[RoundingType]], [[RoundingIncrement]], [[RoundingMode]], [[ComputedRoundingPriority]], [[TrailingZeroDisplay]] »). 1. Return ? InitializePluralRules(_pluralRules_, _locales_, _options_). @@ -172,19 +172,15 @@

    Intl.PluralRules.prototype.resolvedOptions ( )

    1. Let _pr_ be the *this* value. 1. Perform ? RequireInternalSlot(_pr_, [[InitializedPluralRules]]). 1. Let _options_ be OrdinaryObjectCreate(%Object.prototype%). + 1. Let _pluralCategories_ be a List of Strings containing all possible results of PluralRuleSelect for the selected locale _pr_.[[Locale]]. 1. For each row of , except the header row, in table order, do 1. Let _p_ be the Property value of the current row. - 1. Let _v_ be the value of _pr_'s internal slot whose name is the Internal Slot value of the current row. + 1. If _p_ is *"pluralCategories"*, then + 1. Let _v_ be CreateArrayFromList(_pluralCategories_). + 1. Else, + 1. Let _v_ be the value of _pr_'s internal slot whose name is the Internal Slot value of the current row. 1. If _v_ is not *undefined*, then 1. Perform ! CreateDataPropertyOrThrow(_options_, _p_, _v_). - 1. Let _pluralCategories_ be a List of Strings containing all possible results of PluralRuleSelect for the selected locale _pr_.[[Locale]]. - 1. Perform ! CreateDataProperty(_options_, *"pluralCategories"*, CreateArrayFromList(_pluralCategories_)). - 1. If _pr_.[[RoundingType]] is ~morePrecision~, then - 1. Perform ! CreateDataPropertyOrThrow(_options_, *"roundingPriority"*, *"morePrecision"*). - 1. Else if _pr_.[[RoundingType]] is ~lessPrecision~, then - 1. Perform ! CreateDataPropertyOrThrow(_options_, *"roundingPriority"*, *"lessPrecision"*). - 1. Else, - 1. Perform ! CreateDataPropertyOrThrow(_options_, *"roundingPriority"*, *"auto"*). 1. Return _options_.
    @@ -226,13 +222,21 @@

    Intl.PluralRules.prototype.resolvedOptions ( )

    *"maximumSignificantDigits"* - [[RoundingMode]] - *"roundingMode"* + + *"pluralCategories"* [[RoundingIncrement]] *"roundingIncrement"* + + [[RoundingMode]] + *"roundingMode"* + + + [[ComputedRoundingPriority]] + *"roundingPriority"* + [[TrailingZeroDisplay]] *"trailingZeroDisplay"* @@ -263,9 +267,10 @@

    Properties of Intl.PluralRules Instances

  • [[MinimumIntegerDigits]] is a non-negative integer Number value indicating the minimum integer digits to be used.
  • [[MinimumFractionDigits]] and [[MaximumFractionDigits]] are non-negative integer Number values indicating the minimum and maximum fraction digits to be used. Numbers will be rounded or padded with trailing zeroes if necessary.
  • [[MinimumSignificantDigits]] and [[MaximumSignificantDigits]] are positive integer Number values indicating the minimum and maximum fraction digits to be used. Either none or both of these properties are present; if they are, they override minimum and maximum integer and fraction digits.
  • -
  • [[RoundingType]] is one of the values ~fractionDigits~, ~significantDigits~, ~morePrecision~, or ~lessPrecision~, indicating which rounding strategy to use, as discussed in .
  • -
  • [[RoundingMode]] is one of the String values in the Identifier column of , specifying which rounding mode to use.
  • [[RoundingIncrement]] is an integer-valued Number that evenly divides 10, 100, 1000, or 10000 into tenths, fifths, quarters, or halves. It indicates the increment at which rounding should take place relative to the calculated rounding magnitude. For example, if [[MaximumFractionDigits]] is 2 and [[RoundingIncrement]] is 5, then the number is rounded to the nearest 0.05 ("nickel rounding").
  • +
  • [[RoundingMode]] is one of the String values in the Identifier column of , specifying which rounding mode to use.
  • +
  • [[ComputedRoundingPriority]] is one of the String values *"auto"*, *"lessPrecision"*, or *"morePrecision"*, specifying the strategy to resolve mixed fraction digits and significant digits settings.
  • +
  • [[RoundingType]] is one of the values ~fractionDigits~, ~significantDigits~, ~morePrecision~, or ~lessPrecision~, indicating which rounding strategy to use, as discussed in .
  • [[TrailingZeroDisplay]] is one of the String values *"auto"* or *"stripIfInteger"*, indicating whether to strip trailing zeros if the formatted number is an integer (i.e., has no non-zero fraction digit).