1

我想计算贷款摊销,但我不知道如何计算还款日期。

我有Loan amount, Interest rate, Monthly paymnet, Loan Start date. 从这四个值中,我想知道我在 iOS 中的贷款支付日期。

我数InterestMonthly Amount就像

double loanAmount = [self.amount doubleValue];
double intRate = [self.rate doubleValue];
double years = [self.durationCount doubleValue];
double r = intRate / 1200;
double n;
if ([self.duration isEqualToString:@"Yearly"])
{
    n = years * 12;
}
else
{
    n = years;
}
double rPower = pow(1 + r, n);
_monthlyPayment = loanAmount * r * rPower / (rPower - 1);
double annualPayment = _monthlyPayment * 12;
if ([self.duration isEqualToString:@"Yearly"])
{
    _totalAmount = annualPayment * years;
}
else
{
    _totalAmount = annualPayment;
}
self.InterestPaid=_totalAmount-loanAmount;

任何人都可以帮助我吗?

4

0 回答 0