DEV Community

Discussion on: ⛵ Sailing the Choppy Waters of Floating-Point Precision in JavaScript 🔢

Collapse
 
kshyun28 profile image
Jasper Gabriel

As a JavaScript developer, this will always be a recurring caveat that needs proper consideration, especially for applications needing precise calculations.

Have been using a mix of BigNumber and .toFixed() for my needs.

toFixed works well if you only need to handle small decimal places, but for ensuring accuracy for numbers with a lot of decimal places, BigNumber does the job (so far).