finanza/interest/amortization
Amortization schedule generation for an amortising loan.
The schedule lists, for each period, the periodic payment, the portion of that payment that goes to interest, the portion that reduces principal, and the resulting outstanding balance.
Types
Values
pub fn principal_paid(p p: Period) -> decimal.Decimal
Principal component of the payment.
pub fn schedule(
principal principal: decimal.Decimal,
rate_per_period rate_per_period: decimal.Decimal,
periods periods: Int,
digits digits: Int,
) -> Result(List(Period), interest.InterestError)
Build a full amortisation schedule for an amortising loan.
Each row in the returned list is a Period. All
monetary values are rounded to digits decimal places with
HalfEven. The final row is adjusted so the outstanding balance
closes to zero exactly.