Closed jessealama closed 2 weeks ago
Cool, I'm happy to see it! Do you plan to enable Github Issues for discussion at some point?
Cool, I'm happy to see it! Do you plan to enable Github Issues for discussion at some point?
As soon as the proposal moves to Stage 1 in the TC39 process, we can set up a proper TC39-hosted repo thas has issues, etc. Currently, there's a lot in flux. But stay tuned!
A few thoughts after reading the discussion:
I'm not sure how relevant it is, but I saw a few members assuming that financial use cases could "use BigInts to represent cents", which isn't actually possible in real-world systems. If you multiply 1.22 pounds by 3.50 dollars, you're dealing with hundredths of a cent, and then if you multiply by a 0.11 tax rate, you're dealing with ten-thousandths of a cent, and then maybe you add all of those line item totals together and after that you round the subtotal back down to cents. So if you are using bigints to do the arithmetic, they're still having to represent different fractions of a cent at different points.
I hope this proposal doesn't get co-opted to include unit. Unit seems like a very different, more complicated problem.
Closed as discussed (and no longer planned?)
We're happy to announce numeric-with-precision, a stage 0 proposal that is intended to provide a wrapper around a "numeric" (think: Number, Decimal, maybe Bigint, maybe more) plus a precision, which we can intuitively think of as the number of fractional digits for the "numeric".
The idea of considering a numeric-with-precision as a separate idea came out of discussions in the TG3 call, where proposal-decimal was discussed at length. In particular, we discussed the idea of trailing zeroes (or, more generally, just keeping all digits of a number in the data model for decimals and preserving them as arithmetic is done on decimals). This led to a further discussion in the proposal-decimal repo.
We'd love to hear the Intl folks' thoughts on this during the next monthly call on September 23rd. It's still early days here, and we're happy to iterate a bit on the idea. Initially, no decision needs to be made; we just want to announce our effort to the Intl community.