Possible Duplicate:
JavaScript: formatting number with exactly two decimals
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).
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.
$(document).ready(function() {
$('.add').click(function() {
$('#total').text(parseFloat($('#total').text()) + parseFloat($(this).data('amount'))/100);
});
})