The number fields I am using only the one field is returning the error.
$(document).ready(function () { $('.cf-collection-block').on('blur', 'input', sumtotal); $('.subtotal').on('blur', 'input', sumtotal) $('.quantity').on('blur', 'input', sumtotal); function sumtotal() { var sum = 0; $('.cf-collection-block ul').each(function () { var s = 0; s = (parseNumber($(this).find('.price input').val()) *1.085* parseNumber($(this).find('.quantity input').val())); $(this).find('.subtotal input').val(s.toFixed(2)); sum += s; }); $('.total input').val(sum.toFixed(2)); } function parseNumber(n) { var f = parseFloat(n); //Convert to float number. return isNaN(f) ? 0 : f; //treat invalid input as 0; } });
As far as the calculations go, it's working perfectly. I am just not sure why it's wanting an Integer while the Quantity seems to be fine.