PMT函数
1.每月本息金额 = (本金×月利率×(1+月利率)^还款月数)÷ ((1+月利率)^还款月数-1)
function pmt(in_rate in number,in_term in number default 0,in_financeAmount in number) return number is pmt_result number; monthly_interest_rate number; terms number; begin monthly_interest_rate := in_rate; terms := in_term; pmt_result :=(in_financeAmount*monthly_interest_rate*power(1+monthly_interest_rate,terms))/(power(1+monthly_interest_rate,terms)-1); return pmt_result; end;
PPMT函数
2.每月本金 = 本金×月利率×(1+月利率)^(还款月序号-1)÷((1+月利率)^还款月数-1))
function ppmt(in_rate in number,in_term in number default 0,in_financeAmount in number,in_payback_seq in number) return number is ppmt_result number; monthly_interest_rate number; terms number; begin monthly_interest_rate :=in_rate; terms := in_term; ppmt_result :=(in_financeAmount*monthly_interest_rate*(power(1+monthly_interest_rate,in_payback_seq-1)))/(power(1+monthly_interest_rate,terms)-1); return ppmt_result; end;