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

Recent Releases

0.1.008 Aug 2026 17:21 minor feature: Initial release. Level monthly payment, a full per-period amortization schedule with the interest and principal split, lifetime total interest, remaining balance after N payments, and months and interest saved by an extra monthly payment. Five public functions, six unittest blocks, no dependencies.