ecma402 icon indicating copy to clipboard operation
ecma402 copied to clipboard

Decimal integration

Open jessealama opened this issue 1 year ago • 1 comments

It would be good to talk about how to integrate decimals into Ecma 402. One area that needs discussion is what NumberFormat should do with such objects. What kind of API should decimal have that would make things great from the Ecma 402 perspective? We've discussed the issue of trailing zeros in the underlying data model for decimals, and that's the direction we intend to go. To get the discussion started, here are some questions on my mind:

  • Should Decimal's toString throw if one requests, say, more significant digits than are available?
  • Should Decimal throw when one asks for, say, more fractional digits than are available?
  • What if one asks for fewer significant digits than are available in the integer part of a Decimal? E.g., one has the decimal value 123.45` and you ask for 2 significant digits.
  • Are there other places in the Ecma 402 world besides NumberFormat where Decimal might be able to help out?

jessealama avatar Jan 31 '24 10:01 jessealama

TG2 discussion: https://github.com/tc39/ecma402/blob/main/meetings/notes-2024-02-22.md#decimal-integration-856

sffc avatar Feb 23 '24 23:02 sffc