title: Jquery Sum the value which has comma and if has decimal value then sum
body: <p>Iam trying to sum the div value that are comma separated and if has 2 decimal value then sum that decimal value and show if none of it has decimal value then show total.00 in final result but my code is giving me false calculation.</p>
  
  <p><a href="http://jsfiddle.net/shaikasifpasha3/9GVNT/27/" rel="nofollow">JS Fiddle</a></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class=''&gt;432.01&lt;/div&gt;
  &lt;div class=''&gt;4,12,412.01&lt;/div&gt;
  &lt;div class=''&gt;4,12,412.01&lt;/div&gt;
  &lt;div class=''&gt;12,41,241.01&lt;/div&gt;
  &lt;span&gt;&lt;/span&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var sum = 0;
  $('div').each(function() {
      var val = $(this).text().replace(',', '.');
      sum += parseFloat(val, 10);
  });
  $('span').text('result=' + sum);
  </code></pre>