Hi all,
The function below works great in doing my calculation. However I get and 'invalid input' message when a decimal number is entered in either field. Is there a way I can set mileage to (2) decimal places and rate to (3) decimal places?
function sumtotal() { var sum = 0; $('.cf-table-block tbody tr').each(function () { var s = 0.0; s = parseFloat($(this).find('.mileage input').val()) * parseFloat($(this).find('.rate input').val()); s = Math.round(s * 100)/100.0; //round to two decimal places $(this).find('.subtotal input').val(s); sum += s; sum += parseNumber($('.tax input').val()) + parseNumber($('.shipping input').val()); })