var subtotal = parseFloat(val) + parseFloat(tax) + parseFloat(imp) + parseFloat(env); var subtotal = subtotal.toFixed(2); //two decimal places