我在Drupal中有一个表单,我在一个选择更改,两个文本字段和两个文本字段中获取三个值。选择字段本身。我正在减去价值,假设是贷款金额,并且必须根据选择计算EMI,我得到了一个公式,但它不起作用。这是我正在使用的代码......
$(document).ready(function() {
var actualAmount = 100000;
var downPayment = 20000;
var emi_total_amount = actualAmount - downPayment;
var selected_emi_type = $("#edit-field-payment-emi-und option:selected").text();
var emi_amount;
var rate_24 = 15/(12*100);
var rate_30 = 15/(12*100);
var rate_36 = 15.5/(12*100);
var rate_42 = 15.5/(12*100);
var rate_48 = 16/(12*100);
switch (selected_emi_type){
case '6 EMI':
emi_amount = parseInt(emi_total_amount/6);
break;
case '12 EMI':
emi_amount = parseInt(emi_total_amount/12);
break;
case '24 EMI':
emi_amount = emi_total_amount x rate_24 x (1 + rate_24)24 / ((1+rate_24)24 -1);
break;
case '30 EMI':
emi_amount = emi_total_amount x rate_30 x (1 + rate_30)30 / ((1+rate_30)30 -1);
break;
case '36 EMI':
emi_amount = emi_total_amount x rate_36 x (1 + rate_36)36 / ((1+rate_36)36 -1);
break;
case '42 EMI':
emi_amount = emi_total_amount x rate_42 x (1 + rate_42)42 / ((1+rate_42)42 -1);
break;
case '48 EMI':
emi_amount = emi_total_amount x rate_48 x (1 + rate_48)48 / ((1+rate_48)48 -1);
break;
}
alert(emi_amount);
)};
我现在给出示例值。我的开关和所有其他东西工作正常,前两个开关盒也没有配方工具。我知道这个公式可能有问题,但我需要解决它......