proposal-decimal icon indicating copy to clipboard operation
proposal-decimal copied to clipboard

What constitutes a sufficiently compelling use case?

Open sarahghp opened this issue 4 years ago • 2 comments

Concerns about the ROI for a Decimal implementation have been mentioned, with the suggestion that the usage of BigInt does not currently rise to the level where the complexity is worthwhile. I am curious if we can define sufficient desire and then track it here.

sarahghp avatar Feb 02 '22 15:02 sarahghp

I believe the reason BigInt hasn’t seen adoption is that it was designed explicitly not to interoperate with Number - iow, it’s not “the new integer”, it’s a specialized thing only for specific (rare) use cases.

If Decimal was designed to be “the new Number”, with easy interop between them, i suspect its adoption would be quite high.

ljharb avatar Feb 02 '22 15:02 ljharb

If you want to do arithmetic with financial numbers, you need to use a library like financial-number, which is currently backed by BigInt.

A Decimal proposal, if it implemented a changePrecision method similar to financial-number, would eliminate the need for people to find a library to be able to work with financial numbers.

TehShrike avatar Apr 17 '23 18:04 TehShrike