title: Converting a value to 2 decimal places within jQuery
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1726630/javascript-formatting-number-with-exactly-two-decimals">JavaScript: formatting number with exactly two decimals</a>  </p>
  </blockquote>
  
  
  
  <p>Now that I have got a bit of script to add values in to a div with a total in it, I then try to divide the values by 100 to give me a decimal number (to make it look like currency). </p>
  
  <p>After this the script works and gives me a nice decimal float, sometimes though a large recurring number comes after, I want to limit this to two decimals using the script i already have so was wondering if someone could implement something into my current script.</p>
  
  <pre><code>$(document).ready(function() {
    $('.add').click(function() {
       $('#total').text(parseFloat($('#total').text()) + parseFloat($(this).data('amount'))/100);
    });
  })
  </code></pre>