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

Document more about challenges in the current ecosystem

Open littledan opened this issue 5 years ago • 1 comments

The README asserts that not having a decimal type causes problems for JavaScript programmers. Have you faced these problems? If we could document them with the proposal, or link to references, it would be very helpful.

littledan avatar Feb 04 '20 14:02 littledan

Yes, I've had plenty of issues. It seems no-one manages to cover all edge cases when handling money without bigdecimals. Here's a list of issues I've opened over the years:

https://github.com/ikr/money-math/issues/28 https://github.com/dinerojs/dinero.js/issues/7 https://github.com/dinerojs/dinero.js/issues/8 (closed, but not fixed I think) https://github.com/davidkalosi/js-money/issues/32 https://github.com/ikr/money-math/issues/34

Also: https://github.com/openexchangerates/accounting.js/issues/222

Some try to use integers, but in addition to the issues noted in this proposal:

  • Without bigints you'll have a hard time with crypto currencies that have many decimals
  • Currency exchange often use decimals, and you can't just multiply an integer number of cents with a decimal and get the correct solution

magnusjt avatar May 18 '21 09:05 magnusjt