pub fn ppmt<P, F, T>(
rate: f64,
period: u32,
periods: u32,
present_value: P,
future_value: F,
timing: T,
) -> FinanceResult<f64>Expand description
Principal portion of the payment for a single period (Excel PPMT).
§Errors
Same domain as ipmt.
§Examples
use finance_solution::*;
let principal = ppmt(0.01, 1, 12, 10_000.0, 0.0, false).unwrap();
let interest = ipmt(0.01, 1, 12, 10_000.0, 0.0, false).unwrap();
let pmt = payment(0.01, 12, 10_000.0, 0.0, false).unwrap();
assert_approx_equal!(principal + interest, pmt);