我有使用四个字段查找每月付款的公式
Formula: Monthly Payment =Loan amount * ((1 + Interest rate per annum/100) ^ Term of loan) / Term of loan / 12
现在我想找到
如果填充了三个字段中的任何一个。
我还有根据利率,贷款条件和每月付款计算贷款金额的公式。
Formula: Loan amount = Monthly Payment/ ((1 + Interest rate per annum/100) ^ Term of loan) * Term of loan * 12
但它没有计算完美的数字。
任何人都可以给我这三个计算贷款金额/利率/贷款条款的公式(将更加赞赏java脚本)
答案 0 :(得分:12)
这是我的,
公式:
M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
希望这在某种程度上有所帮助
var M; //monthly mortgage payment
var P = 400000; //principle / initial amount borrowed
var I = 3.5 / 100 / 12; //monthly interest rate
var N = 30 * 12; //number of payments months
//monthly mortgage payment
M = monthlyPayment(P, N, I);
console.log(M);
function monthlyPayment(p, n, i) {
return p * i * (Math.pow(1 + i, n)) / (Math.pow(1 + i, n) - 1);
}
答案 1 :(得分:1)
var deno = (100 + Interest_rate_per_annum)/100;
var pdeno = Math.pow(deno, Term_of_Loan);
var loan_amount = (Monthly_payment * Term_of_Loan * 12) / pdeno;
答案 2 :(得分:0)
这与@shay给出的答案完全相同,但其变量名被拼写清楚,使我更容易理解:
myPreparedStatement.setObject( … , odt ) ;