title: How subtraction of two float values in JavaScript?
body: <p>I have an issue with the subtraction of two values. when I set discount_amt value to 2.5 then total return me 0.5 but when discount_amt is set to 2.6 it return 0.3999999999999999 instead of 0.4 why?</p>
  <pre><code>var total        = parseFloat('3').toFixed(1);
  var discount_amt = parseFloat('2.6').toFixed(1);
      total        = total - discount_amt;
      console.log(total);
  </code></pre>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var total        = parseFloat('3').toFixed(1);
  var discount_amt = parseFloat('2.6').toFixed(1);
      total        = total - discount_amt;
      console.log(total);</code></pre>
  </div>
  </div>
  </p>