我想计算贷款摊还,但我不知道如何计算支付日期。
我有Loan amount
,Interest rate
,Monthly paymnet
,Loan Start date
。从这四个值我想知道iOS中的贷款支付日期。
我将Interest
,Monthly 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;
任何人都可以帮助我?