var discount_amount = parseFloat($('#amtdelivary').val());
var other_discount = parseFloat($('#othdis').val());
calculate_total_amount=Math.round(sub_total1 + tax_amount +discount_amount-other_discount);
$('#fnltot').val(calculate_total_amount);
当我将 other_discount 文本字段保留为空时,它显示一个 NaN。如果文本字段为 0,则其功能准确,但当该字段设置为空时,其结果为 NaN。
if(isNaN(other_discount)){
other_discount=0;
}
我厌倦了这些,但它不起作用。