Expand description
§amortization-schedule
Loan amortization math: fixed-rate monthly payment, per-period interest/principal split, remaining balance, and lifetime interest. Pure Rust, no deps. Same math behind the AssetLoanCalculator amortization tool.
use amortization_schedule::{monthly_payment, total_interest};
let p = monthly_payment(100_000.0, 0.07, 360); // ~665.30
let ti = total_interest(100_000.0, 0.07, 360);
assert!(p > 0.0 && ti > 0.0);Functions§
- monthly_
payment - Monthly payment on a fully-amortizing fixed-rate loan.
- period
- One period of an amortizing loan: (interest, principal_paid, remaining_balance_after).
- schedule
- Full schedule as a Vec of (interest, principal_paid, remaining_balance) per period.
- total_
interest - Total interest paid over the life of a fixed-rate amortizing loan.