I have a table set up to calculate the total. seems like anything 3 digits calculates correctly except for when i enter the amount in thousands, it looks like the code drops the "0" and returns just the first digit. ie: $3000 shows an adjustment total of $3.
$(document).ready(function() {
$(document).on('blur change', '.chg_amount input', sumtotal);
function sumtotal() {
var s = 0;
$('.chg_amount input').each(function () {
s += parseNumber($(this).val().replace('-', ''));
});
$('.total input').val(s.toFixed(2));
}
function parseNumber(n) {
var f = parseFloat(n); //Convert to float number.
return isNaN(f) ? 0 : f; //treat invalid input as 0;
}