DEV
Read post

Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve?

The article explains why adding 0.6 and 0.3 in JavaScript results in 0.8999999999999999 due to how computers handle floating-point numbers. It also provides approaches to achieve accurate results when working with currency or financial calculations.

    #javascript#hacktoberfest
Nov 17, 2023•6m read time•From dev.to
Post cover image
Table of contents
Why does this happen?Let’s understand with an example how decimal numbers are stored and unveil why 0.6+0.3 equals 0.8999999999999999How to Solve That?Conclusion
30 Impressions
DEV's image
DEV

Dev.to is a community platform for developers, offering resources, discussions, and networking oppor...

12.1K Followers

•

83.8K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard