还贷款 月供贷款计算

来源:互联网 发布:全球云计算开源大会 编辑:程序博客网 时间:2024/06/10 19:00
//每月本金 = 本金×月利率×(1+月利率)^(还款月序号-1)÷((1+月利率)^还款月数-1)
//每月利息  = 剩余本金 x贷款月利率
//每月本息金额  = (本金×月利率×(1+月利率)^还款月数)÷ ((1+月利率)^还款月数-1)

/**
 * @brief计算等额本息还款月供
 * @param fullPrice
商品总价;
 * @param firstPayLimit
首付额度0< firstPayLimit <1
 * @param payYear
还款年限
 * @param yearRate
年利率
 * @return monthly
月还款数
 */

- (
CGFloat)getMonThyFullPrice:(CGFloat)fullPrice withFirstPayLimit:(CGFloat)firstPayLimit withPayYear:(NSInteger)payYear withYearRate:(CGFloat)yearRate {
   
// 每月还款额=[贷款本金×月利率×1+月利率)^还款月数]÷[1+月利率)^还款月数-1]

   
CGFloat capital = fullPrice*(1.0 - firstPayLimit);//贷款本金
   
NSInteger month = payYear *12;//还款月数
   
CGFloat monthRate = yearRate /12;//月利率
   
CGFloat parameter =pow(1+monthRate, month);
   
CGFloat monthly =(capital * monthRate * parameter) / (parameter -1);//每月还款额
   
   
return monthly;
}
0 0
原创粉丝点击