我不是金融大佬,勉强算个码农大佬,给你解答下计算方式。
利率是事先定好的,你这个方案下就是 9.88%,然后根据这个利率计算每月还款数,具体公式如下(前端代码里找出来的):
var bonus = Math.round(loan * sol.yearPayPer / 100); //年度还款
if (month == 48) {
mPay = Math.round(((loan - bonus * (1 / Math.pow((1 + rate / 12), 12) + 1 / Math.pow((1 + rate / 12), 24) + 1 / Math.pow((1 + rate / 12), 36) + 1 / Math.pow((1 + rate / 12), 48))) / (Math.pow((1 + rate / 12), 11) - 1) / ((12 / rate + 12 / Math.pow((1 + rate / 12), 12) / rate + 12 / Math.pow((1 + rate / 12), 24) / rate + 12 / Math.pow((1 + rate / 12), 36) / rate)) * Math.pow((1 + rate / 12), 11))*100)/100;
} else if (month == 36) {
mPay = Math.round(((loan - bonus * (1 / Math.pow((1 + rate / 12), 12) + 1 / Math.pow((1 + rate / 12), 24) + 1 / Math.pow((1 + rate / 12), 36))) / (Math.pow((rate / 12 + 1), 11) - 1) / ((12 / rate + 12 / Math.pow((1 + rate / 12), 12) / rate + 12 / Math.pow((rate / 12 + 1), 24) / rate)) * Math.pow((1 + rate / 12), 11))*100)/100;
} else if (month == 24) {
mPay = Math.round(((loan - bonus * (1 / Math.pow((1 + rate / 12), 12) + 1 / Math.pow((1 + rate / 12), 24))) / (Math.pow((rate / 12 + 1), 11) - 1) / ((12 / rate + 12 / Math.pow((rate / 12 + 1), 12) / rate)) * Math.pow((1 + rate / 12), 11))*100)/100;
}
mpay = 每月还款数
loan = 贷款数
rate = 利率,9.88%
Math.round(x) = 函数,对 x 四舍五入
Math.pow(x, y) = 函数,求 x 的 y 次方