You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<dd>It populates the internal slots of _intlObj_ that affect locale-independent number rounding (see <emu-xrefhref="#sec-formatnumberstring"></emu-xref>).</dd>
98
+
<dd>It populates the internal slots of _intlObj_ that affect locale-independent number rounding (see <emu-xrefhref="#sec-formatnumerictostring"></emu-xref>).</dd>
99
99
</dl>
100
100
<emu-alg>
101
101
1. Let _mnid_ be ? GetNumberOption(_options_, *"minimumIntegerDigits,"*, 1, 21, 1).
@@ -527,7 +527,7 @@ <h1>Properties of Intl.NumberFormat Instances</h1>
527
527
In scientific notation, this slot affects the sign display of the mantissa but not the exponent.
528
528
</li>
529
529
<li>[[RoundingIncrement]] is an integer 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 formatted numbers are rounded to the nearest 0.05 ("nickel rounding").</li>
530
-
<li>[[RoundingMode]] is one of the String values in the Identifier column of <emu-xrefhref="#table-intl-rounding-modes"></emu-xref>, specifying which rounding mode to use.</li>
530
+
<li>[[RoundingMode]] is a <dfnid="rounding-mode">rounding mode</dfn>, one of the String values in the Identifier column of <emu-xrefhref="#table-intl-rounding-modes"></emu-xref>.</li>
531
531
<li>[[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).</li>
532
532
</ul>
533
533
@@ -673,7 +673,7 @@ <h1>Number Format Functions</h1>
673
673
<p>The *"length"* property of a Number format function is *1*<sub>𝔽</sub>.</p>
1. Let _sResult_ be ToRawPrecision(_x_, _intlObject_.[[MinimumSignificantDigits]], _intlObject_.[[MaximumSignificantDigits]], _unsignedRoundingMode_).
704
704
1. Let _fResult_ be ToRawFixed(_x_, _intlObject_.[[MinimumFractionDigits]], _intlObject_.[[MaximumFractionDigits]], _intlObject_.[[RoundingIncrement]], _unsignedRoundingMode_).
705
-
1. If _intlObject_.[[RoundingType]] is ~more-precision~, then
706
-
1. If _sResult_.[[RoundingMagnitude]] ≤ _fResult_.[[RoundingMagnitude]], then
707
-
1. Let _result_ be _sResult_.
708
-
1. Else,
709
-
1. Let _result_ be _fResult_.
705
+
1. If _fResult_.[[RoundingMagnitude]] <_sResult_.[[RoundingMagnitude]], let _fixedIsMorePrecise_ be *true*; else let _fixedIsMorePrecise_ be *false*.
706
+
1. If _intlObject_.[[RoundingType]] is ~more-precision~ and _fixedIsMorePrecise_ is *true*, then
707
+
1. Let _result_ be _fResult_.
708
+
1. Else if _intlObject_.[[RoundingType]] is ~less-precision~ and _fixedIsMorePrecise_ is *false*, then
709
+
1. Let _result_ be _fResult_.
710
710
1. Else,
711
-
1.Assert:_intlObject_.[[RoundingType]] is ~less-precision~.
712
-
1. If _sResult_.[[RoundingMagnitude]] ≤ _fResult_.[[RoundingMagnitude]], then
713
-
1. Let _result_ be _fResult_.
714
-
1. Else,
715
-
1. Let _result_ be _sResult_.
711
+
1. Let _result_ be _sResult_.
716
712
1. Set _x_ to _result_.[[RoundedNumber]].
717
713
1. Let _string_ be _result_.[[FormattedString]].
718
714
1. If _intlObject_.[[TrailingZeroDisplay]] is *"stripIfInteger"* and <emu-eqn>_x_ modulo 1 = 0</emu-eqn>, then
_minPrecision_: an integer in the inclusive interval from 1 to 21,
1277
1273
_maxPrecision_: an integer in the inclusive interval from 1 to 21,
1278
1274
_unsignedRoundingMode_: a specification type from the Unsigned Rounding Mode column of <emu-xrefhref="#table-intl-unsigned-rounding-modes"></emu-xref>, or *undefined*,
@@ -1297,15 +1293,13 @@ <h1>
1297
1293
1. Else,
1298
1294
1.[declared="n1,e1,r1"] Let _n1_ and _e1_ each be an integer and _r1_ a mathematical value, with <emu-eqn>_r1_ = ToRawPrecisionFn(_n1_, _e1_, _p_)</emu-eqn>, such that <emu-eqn>_r1_ ≤ _x_</emu-eqn> and _r1_ is maximized.
1299
1295
1.[declared="n2,e2,r2"] Let _n2_ and _e2_ each be an integer and _r2_ a mathematical value, with <emu-eqn>_r2_ = ToRawPrecisionFn(_n2_, _e2_, _p_)</emu-eqn>, such that <emu-eqn>_r2_ ≥ _x_</emu-eqn> and _r2_ is minimized.
1300
-
1. Let _r_ be ApplyUnsignedRoundingMode(_x_, _r1_, _r2_, _unsignedRoundingMode_).
1301
-
1. If _r_ is _r1_, then
1296
+
1. Let _xFinal_ be ApplyUnsignedRoundingMode(_x_, _r1_, _r2_, _unsignedRoundingMode_).
1297
+
1. If _xFinal_ is _r1_, then
1302
1298
1. Let _n_ be _n1_.
1303
1299
1. Let _e_ be _e1_.
1304
-
1. Let _xFinal_ be _r1_.
1305
1300
1. Else,
1306
1301
1. Let _n_ be _n2_.
1307
1302
1. Let _e_ be _e2_.
1308
-
1. Let _xFinal_ be _r2_.
1309
1303
1. Let _m_ be the String consisting of the digits of the decimal representation of _n_ (in order, with no leading zeroes).
1310
1304
1. If _e_ ≥ (_p_ - 1), then
1311
1305
1. Set _m_ to the string-concatenation of _m_ and _e_ - _p_ + 1 occurrences of the code unit 0x0030 (DIGIT ZERO).
_minFraction_: an integer in the inclusive interval from 0 to 100,
1336
1330
_maxFraction_: an integer in the inclusive interval from 0 to 100,
1337
1331
_roundingIncrement_: an integer,
@@ -1351,13 +1345,8 @@ <h1>
1351
1345
1. Let _f_ be _maxFraction_.
1352
1346
1.[declared="n1,r1"] Let _n1_ be an integer and _r1_ a mathematical value, with <emu-eqn>_r1_ = ToRawFixedFn(_n1_, _f_)</emu-eqn>, such that <emu-eqn>_n1_ modulo _roundingIncrement_ = 0</emu-eqn>, <emu-eqn>_r1_ ≤ _x_</emu-eqn>, and _r1_ is maximized.
1353
1347
1.[declared="n2,r2"] Let _n2_ be an integer and _r2_ a mathematical value, with <emu-eqn>_r2_ = ToRawFixedFn(_n2_, _f_)</emu-eqn>, such that <emu-eqn>_n2_ modulo _roundingIncrement_ = 0</emu-eqn>, <emu-eqn>_r2_ ≥ _x_</emu-eqn>, and _r2_ is minimized.
1354
-
1. Let _r_ be ApplyUnsignedRoundingMode(_x_, _r1_, _r2_, _unsignedRoundingMode_).
1355
-
1. If _r_ is _r1_, then
1356
-
1. Let _n_ be _n1_.
1357
-
1. Let _xFinal_ be _r1_.
1358
-
1. Else,
1359
-
1. Let _n_ be _n2_.
1360
-
1. Let _xFinal_ be _r2_.
1348
+
1. Let _xFinal_ be ApplyUnsignedRoundingMode(_x_, _r1_, _r2_, _unsignedRoundingMode_).
1349
+
1. If _xFinal_ is _r1_, let _n_ be _n1_. Otherwise, let _n_ be _n2_.
1361
1350
1. If _n_ = 0, let _m_ be *"0"*. Otherwise, let _m_ be the String consisting of the digits of the decimal representation of _n_ (in order, with no leading zeroes).
): a specification type from the Unsigned Rounding Mode column of <emu-xrefhref="#table-intl-unsigned-rounding-modes"></emu-xref>
1683
1672
</h1>
1684
1673
<dlclass="header">
1685
1674
<dt>description</dt>
1686
-
<dd>It returns the rounding mode that should be applied to the absolute value of a number to produce the same result as if _roundingMode_, one of the String values in the Identifier column of <emu-xrefhref="#table-intl-rounding-modes"></emu-xref>, were applied to the signed value of the number (negative if _sign_ is ~negative~, or positive otherwise).</dd>
1675
+
<dd>It returns the <emu-not-ref>rounding mode</emu-not-ref> that should be applied to the absolute value of a number to produce the same result as if _roundingMode_ were applied to the signed value of the number (negative if _sign_ is ~negative~, or positive otherwise).</dd>
1687
1676
</dl>
1688
1677
<emu-alg>
1689
1678
1. Return the specification type in the Unsigned Rounding Mode column of <emu-xrefhref="#table-intl-unsigned-rounding-modes"></emu-xref> for the row where the value in the Identifier column is _roundingMode_ and the value in the Sign column is _sign_.
Copy file name to clipboardExpand all lines: spec/pluralrules.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -235,7 +235,7 @@ <h1>Properties of Intl.PluralRules Instances</h1>
235
235
<li>[[RoundingType]] is one of the values ~fraction-digits~, ~significant-digits~, ~more-precision~, or ~less-precision~, indicating which rounding strategy to use, as discussed in <emu-xrefhref="#sec-properties-of-intl-numberformat-instances"></emu-xref>.</li>
236
236
<li>[[ComputedRoundingPriority]] is one of the String values *"auto"*, *"morePrecision"*, or *"lessPrecision"*. It is only used in <emu-xrefhref="#sec-intl.pluralrules.prototype.resolvedoptions"></emu-xref> to convert [[RoundingType]] back to a valid *"roundingPriority"* option.</li>
237
237
<li>[[RoundingIncrement]] is an integer 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 formatted numbers are rounded to the nearest 0.05 ("nickel rounding").</li>
238
-
<li>[[RoundingMode]] is one of the String values in the Identifier column of <emu-xrefhref="#table-intl-rounding-modes"></emu-xref>, specifying which rounding mode to use.</li>
238
+
<li>[[RoundingMode]] identifies the rounding mode to use.</li>
239
239
<li>[[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).</li>
0 commit comments