LoanPlan
Loan repayment schedules in whole cents: annuity, differentiated and interest-only, three day-count bases and early repayments. The last payment carries no rounding tail.
A schedule calculating machine
A stack of coins is the balance owed. Each turn of the crank prints a row: interest, principal and the new balance. The last row empties the stack exactly, with no tail.
Money without fractions
Amounts are stored as whole cents, and interest is computed with integers and rounded once per period. The annuity payment is the smallest whole-cent amount that repays the loan on time: a binary search finds it using the same calculation that prints the table.
Invariants
Each opening balance equals the previous closing balance, the final balance is zero, and principal paid plus early repayments equals the amount lent. A schedule starting on 31 January moves to 29 February and back to 31 March.
Under the hood
- Annuity, differentiated and interest-only.
- Actual/365, Actual/360 and 30E/360 day counts.
- Early repayments and a fixed fee.
- 1 to 1,200 months, JSON in and out.
- Integer arithmetic with no floats.