|
|
@ -1608,6 +1608,9 @@ public class LoanSolutionsService extends MybatisBaseService<LoanSolutionsMapper |
|
|
|
public static BigDecimal calculatePMT(double rate, double nper, double pv) { |
|
|
|
double v = (1 + (rate / 12)); |
|
|
|
double t = (-(nper / nper) * nper); |
|
|
|
if(rate == 0.0){ |
|
|
|
return BigDecimal.ZERO; |
|
|
|
} |
|
|
|
double result = (pv * (rate / 12)) / (1 - Math.pow(v, t)); |
|
|
|
return new BigDecimal(result); |
|
|
|
} |
|
|
|