diff --git a/index.html b/index.html
index 2dfeae25..7cbabe60 100644
--- a/index.html
+++ b/index.html
@@ -3231,7 +3231,7 @@
Stage 1 Draft / July 24, 2024
Decimal
+ Stage 1 Draft / July 25, 2024
Decimal
Introduction
@@ -3780,7 +3780,7 @@ 4.1.1.1 ToIntlMathematicalValue ( value
4.1.1.2 FormatNumericToString ( intlObject, x )
The abstract operation FormatNumericToString takes arguments intlObject (an Object) and x (a mathematical value, negative-zero, or a finite Decimal128 value) and returns a Record with fields [[RoundedNumber]] (a mathematical value or negative-zero) and [[FormattedString]] (a String). It rounds x to an Intl mathematical value according to the internal slots of intlObject. The [[RoundedNumber]] field contains the rounded result value and the [[FormattedString]] field contains a String value representation of that result formatted according to the internal slots of intlObject. It performs the following steps when called:
- - Assert: intlObject has [[RoundingMode]], [[RoundingType]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[RoundingIncrement]], and [[TrailingZeroDisplay]] internal slots.
- If x is negative-zero, then
- Let sign be negative.
- Set x to 0.
- If x is a Decimal128 value, then
- Let v be cohort(x).
- If v is +0𝔻, then
- Set x to 0.
- Else if v is -0𝔻, then
- Let sign be negative.
- Otherwise:
- If v < 0, set sign to negative.
- Else, let sign be positive.
- If sign is negative, set x to Decimal128Abs(x).
- Else,
- Assert: x is a mathematical value.
- If x < 0, let sign be negative; else let sign be positive.
- If sign is negative, then
- Set x to -x.
- Let unsignedRoundingMode be GetUnsignedRoundingMode(intlObject.[[RoundingMode]], sign).
- If intlObject.[[RoundingType]] is significant-digits, then
- Let result be ToRawPrecision(x, intlObject.[[MinimumSignificantDigits]], intlObject.[[MaximumSignificantDigits]], unsignedRoundingMode).
- Else if intlObject.[[RoundingType]] is fraction-digits, then
- Let result be ToRawFixed(x, intlObject.[[MinimumFractionDigits]], intlObject.[[MaximumFractionDigits]], intlObject.[[RoundingIncrement]], unsignedRoundingMode).
- Else,
- Let sResult be ToRawPrecision(x, intlObject.[[MinimumSignificantDigits]], intlObject.[[MaximumSignificantDigits]], unsignedRoundingMode).
- Let fResult be ToRawFixed(x, intlObject.[[MinimumFractionDigits]], intlObject.[[MaximumFractionDigits]], intlObject.[[RoundingIncrement]], unsignedRoundingMode).
- If intlObject.[[RoundingType]] is more-precision, then
- If sResult.[[RoundingMagnitude]] ≤ fResult.[[RoundingMagnitude]], then
- Let result be sResult.
- Else,
- Let result be fResult.
- Else,
- Assert: intlObject.[[RoundingType]] is less-precision.
- If sResult.[[RoundingMagnitude]] ≤ fResult.[[RoundingMagnitude]], then
- Let result be fResult.
- Else,
- Let result be sResult.
- Set x to result.[[RoundedNumber]].
- Let string be result.[[FormattedString]].
- If intlObject.[[TrailingZeroDisplay]] is "stripIfInteger" and x modulo 1 = 0, then
- Let i be StringIndexOf(string, ".", 0).
- If i ≠ -1, set string to the substring of string from 0 to i.
- Let int be result.[[IntegerDigitsCount]].
- Let minInteger be intlObject.[[MinimumIntegerDigits]].
- If int < minInteger, then
- Let forwardZeros be the String consisting of minInteger - int occurrences of the code unit 0x0030 (DIGIT ZERO).
- Set string to the string-concatenation of forwardZeros and string.
- If sign is negative, then
- If x is 0, set x to negative-zero. Otherwise, set x to -x.
- Return the Record { [[RoundedNumber]]: x, [[FormattedString]]: string }.
+ - Assert: intlObject has [[RoundingMode]], [[RoundingType]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[RoundingIncrement]], and [[TrailingZeroDisplay]] internal slots.
- If x is negative-zero, then
- Let sign be negative.
- Set x to 0.
- If x is a Decimal128 value, then
- Let v be cohort(x).
- If v is +0𝔻, then
- Let sign be positive.
- Else if v is -0𝔻, then
- Let sign be negative.
- Otherwise:
- If v < 0, let sign to negative.
- Else, let sign be positive.
- If sign is negative, set x to Decimal128Abs(x).
- Else,
- Assert: x is a mathematical value.
- If x < 0, let sign be negative; else let sign be positive.
- If sign is negative, then
- Set x to -x.
- Let unsignedRoundingMode be GetUnsignedRoundingMode(intlObject.[[RoundingMode]], sign).
- If intlObject.[[RoundingType]] is significant-digits, then
- Let result be ToRawPrecision(x, intlObject.[[MinimumSignificantDigits]], intlObject.[[MaximumSignificantDigits]], unsignedRoundingMode).
- Else if intlObject.[[RoundingType]] is fraction-digits, then
- Let result be ToRawFixed(x, intlObject.[[MinimumFractionDigits]], intlObject.[[MaximumFractionDigits]], intlObject.[[RoundingIncrement]], unsignedRoundingMode).
- Else,
- Let sResult be ToRawPrecision(x, intlObject.[[MinimumSignificantDigits]], intlObject.[[MaximumSignificantDigits]], unsignedRoundingMode).
- Let fResult be ToRawFixed(x, intlObject.[[MinimumFractionDigits]], intlObject.[[MaximumFractionDigits]], intlObject.[[RoundingIncrement]], unsignedRoundingMode).
- If intlObject.[[RoundingType]] is more-precision, then
- If sResult.[[RoundingMagnitude]] ≤ fResult.[[RoundingMagnitude]], then
- Let result be sResult.
- Else,
- Let result be fResult.
- Else,
- Assert: intlObject.[[RoundingType]] is less-precision.
- If sResult.[[RoundingMagnitude]] ≤ fResult.[[RoundingMagnitude]], then
- Let result be fResult.
- Else,
- Let result be sResult.
- Set x to result.[[RoundedNumber]].
- Let string be result.[[FormattedString]].
- If intlObject.[[TrailingZeroDisplay]] is "stripIfInteger" and x modulo 1 = 0, then
- Let i be StringIndexOf(string, ".", 0).
- If i ≠ -1, set string to the substring of string from 0 to i.
- Let int be result.[[IntegerDigitsCount]].
- Let minInteger be intlObject.[[MinimumIntegerDigits]].
- If int < minInteger, then
- Let forwardZeros be the String consisting of minInteger - int occurrences of the code unit 0x0030 (DIGIT ZERO).
- Set string to the string-concatenation of forwardZeros and string.
- If sign is negative, then
- If x is 0, set x to negative-zero. Otherwise, set x to -x.
- Return the Record { [[RoundedNumber]]: x, [[FormattedString]]: string }.