From a4c761cf8329e48f5bcb0851c8b078260a451b86 Mon Sep 17 00:00:00 2001 From: Jesse Alama Date: Fri, 12 Apr 2024 13:50:35 +0200 Subject: [PATCH] Add TODO for convertToDecimalCharacter (#112) * Add TODO for convertToDecimalCharacter * fixup: [spec] `npm run build` --- index.html | 4 ++-- spec.emu | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 4fc34db1..b35dd4f4 100644 --- a/index.html +++ b/index.html @@ -2983,7 +2983,7 @@

Stage 1 Draft / March 29, 2024

Decimal

+

Stage 1 Draft / April 4, 2024

Decimal

1 Scope

@@ -3111,7 +3111,7 @@

4.13 Decimal128.prototype.round ( numFracti

4.14 Decimal128.prototype.toString ( [ options ] )

Renders this value as a signed decimal string. options, is defined, is supposed to be a plain object. If options has the property numDecimal128Digits and the value of that property is a non-negative Number, the return value will be a string that has exactly that many digits after the decimal point, possibly with the addition of trailing zeros.

-
  1. Let roundingMode be [[_options_]][roundingMode]].
  2. If roundingMode is not one of "ceil", "floor", "expand", "trunc", "halfEven", "halfExpand", "halfCeil", "halfFloor", or "halfTrunc", then
    1. set roundingMode to "halfEven".
  3. Let format be [[_options_]][format]].
  4. If format is not one of "decimal" or "exponential", then
    1. set format to "decimal".
  5. If format is "decimal", then
    1. return the result of calling IEEE 754's convertToDecimalCharacter with a second argument ensuring that a signed decimal string is generated.
  6. Return the result of calling IEEE 754's convertToDecimalCharacter with a second argument ensuring that a signed exponential string is generated.
+
  1. Let roundingMode be [[_options_]][roundingMode]].
  2. If roundingMode is not one of "ceil", "floor", "expand", "trunc", "halfEven", "halfExpand", "halfCeil", "halfFloor", or "halfTrunc", then
    1. set roundingMode to "halfEven".
  3. Let format be [[_options_]][format]].
  4. If format is not one of "decimal" or "exponential", then
    1. set format to "decimal".
  5. If format is "decimal", then
    1. return the result of calling IEEE 754's convertToDecimalCharacter with a second argument ensuring that a signed decimal string is generated. TODO convertToDecimalCharacter is unspecified, so we need to do that work here.
  6. Return the result of calling IEEE 754's convertToDecimalCharacter with a second argument ensuring that a signed exponential string is generated. TODO convertToDecimalCharacter is unspecified, so we need to do that work here.

4.15 Decimal128.prototype.valueOf ( x )

diff --git a/spec.emu b/spec.emu index 4d1e9721..20ebd51d 100644 --- a/spec.emu +++ b/spec.emu @@ -209,8 +209,8 @@ location: https://github.com/tc39/proposal-decimal/ 1. If _format_ is not one of *"decimal"* or *"exponential"*, then 1. set _format_ to *"decimal"*. 1. If _format_ is *"decimal*", then - 1. return the result of calling IEEE 754's convertToDecimalCharacter with a second argument ensuring that a signed decimal string is generated. - 1. Return the result of calling IEEE 754's convertToDecimalCharacter with a second argument ensuring that a signed exponential string is generated. + 1. return the result of calling IEEE 754's convertToDecimalCharacter with a second argument ensuring that a signed decimal string is generated. TODO convertToDecimalCharacter is unspecified, so we need to do that work here. + 1. Return the result of calling IEEE 754's convertToDecimalCharacter with a second argument ensuring that a signed exponential string is generated. TODO convertToDecimalCharacter is unspecified, so we need to do that work here.