Precise Decimal Math in JavaScript with Fraction.js
How to handle exact decimal calculations in JavaScript when floating-point precision isn't good enough
Have you ever tried to perform precise calculations in JavaScript? These issues can cause serious problems, especially when dealing with money, percentages, or any calculations that require exact accuracy.
0.1 + 0.2 // 0.30000000000000004
This isn’t a JavaScript bug.