Javascript not adding properly?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/588004/is-javascripts-math-broken">Is JavaScript’s Math broken?</a>  </p>
</blockquote>



<p>so am trying to add two numbers, one contains a decimal and the other doesn't.
The first input contains the number 5 and the other contains 5.22 and getting a total of 
10.2199999999 .</p>

<pre><code>for (var counter = 0; counter &lt; fieldsId.length; counter++) {
    console.debug($("#" + fieldsId[counter] + "_" + idService).val()); //debug
    sum = parseFloat($("#" + fieldsId[counter] + "_" + idService).val()) + parseFloat(sum);

    console.debug(sum); //debug
}​
</code></pre>

<p>After debugging am getting the values:</p>

<pre><code>5
5 
5.22
10.21999999999
</code></pre>
