loanamort 0.1.0
loanamort is a small D library for fixed-rate loan amortization. A mortgage, an auto loan and a personal loan are the same object: a level monthly payment that covers the interest accruing on the balance and retires the principal over a fixed term. Five public functions. monthlyPayment applies the standard amortization formula. amortizationSchedule returns one row per payment with the interest and principal split and the running balance. totalInterest sums the interest paid across the whole term. remainingBalance gives the principal still owed after a number of payments. payoffWithExtra reports how many months and how much interest an extra monthly amount removes. Everything is @safe pure and dependency-free, with input contracts rejecting a negative principal, a non-positive term or a negative extra payment. The formula used is written out in the module documentation rather than left implicit. Six unittest blocks, MIT licensed.
| Tags | d dlang library finance loans amortization |
|---|---|
| License | MITL |
| State | initial |