//Calculate 2 Day Per Diem subtotal $('.perdiemsum').on('blur change', 'input', perdiemsumtotal); function perdiemsumtotal() { var s = 1; $('.perdiemsum input').each(function () { s *= parseNumber($(this).val()); }); $('.perdiemtotal input').val(s); } function parseNumber(n) { var f = parseFloat(n); //Convert to float number. return isNaN(f) ? 0 : f; //treat invalid input as 0; } //end calculate 2 Day Per Diem subtotal
I am working on a travel reimbursement form and have come across a calculation problem when using IE 11.0.9600. The calculation works correctly in the latest version of Firefox and Chrome.
Below is a screenshot of the fields and their values. The user should enter the Per Diem rate which is then calculated by the "Number of Days" field to give the "per diem subtotal". You can see in the screenshot that with IE 11 it is not calculating correctly. Below is also the JavaScript being used.