var totalAmount = 0; totalAmount = Number($("#sub_amount").val()) + Number($("#vat_amount").val()); totalAmount = totalAmount.toFixed(2); $('#total_amount').val(totalAmount); //@sujay