<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/decoding-why-0-6-0-3-0-8999999999999999-in-js-and-how-to-solve--7qmvib8m0" -->

---
title: Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and...
description: 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...
canonical: https://daily.dev/posts/decoding-why-0-6-0-3-0-8999999999999999-in-js-and-how-to-solve--7qmvib8m0
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve? | daily.dev
og:description: 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...
og:url: https://daily.dev/posts/decoding-why-0-6-0-3-0-8999999999999999-in-js-and-how-to-solve--7qmvib8m0
og:image: https://api.daily.dev/og/posts/7QmVIB8m0.png
og:image:alt: Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

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

**[DEV](https://daily.dev/sources/devto)** · 6 min read · 0 upvotes · 0 comments

## Summary

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.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dev.to/jeevaramanathan/decoding-why-06-03-08999999999999999-in-js-and-how-to-solve-640>

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#hacktoberfest](https://daily.dev/tags/hacktoberfest)

[View this post on daily.dev](https://daily.dev/posts/decoding-why-0-6-0-3-0-8999999999999999-in-js-and-how-to-solve--7qmvib8m0)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve?","url":"https://daily.dev/posts/decoding-why-0-6-0-3-0-8999999999999999-in-js-and-how-to-solve--7qmvib8m0","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/decoding-why-0-6-0-3-0-8999999999999999-in-js-and-how-to-solve--7qmvib8m0"},"datePublished":"2023-11-17T18:07:52.052Z","dateModified":"2023-11-16T20:07:32.733Z","description":"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...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/691b4eeb5e9b94052d111d50f1695a07?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/691b4eeb5e9b94052d111d50f1695a07?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"DEV","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DEV","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/devto","url":"https://daily.dev/sources/devto"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/decoding-why-0-6-0-3-0-8999999999999999-in-js-and-how-to-solve--7qmvib8m0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript,hacktoberfest","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DEV","item":"https://daily.dev/sources/devto"},{"@type":"ListItem","position":3,"name":"Decoding Why 0.6 + 0.3 = 0.8999999999999999 in JS and How to Solve?"}]}
```

