title: How decimals are calculated in javascript
body: <p>I have to do some calculation in decimals in my application using javascript but the result
  is unexpected.</p>
  
  <p>The result of the below statement is 1.707 [as expected]</p>
  
  <pre><code>var total=1.17+0.237+0.3;
  </code></pre>
  
  <p>also when we add the numbers below, I am getting 0.7070000000000001 [unexpected]</p>
  
  <pre><code>var totalnew=0.17+0.237+0.3;
  </code></pre>
  
  <p>Also, the expression (0.1+0.2===0.3) returns false[unexpected], but (1.1+0.2===1.3) returns true[as expected] .
  Why is this happening and what is the workaround for this.</p>