Function fv

Source
pub fn fv<T: FloatLike>(
    rate: T,
    nper: T,
    pmt: T,
    pv: Option<T>,
    due: Option<bool>,
) -> T
Expand description

FV - Future Value

A general future value calculation, similar to the Excel FV function.

The future value (FV) is the value of an asset or cash at a specified date in the future based on a certain rate of return. The future value is the amount of money that an investment made today will grow to by a future date. It is calculated by applying a rate of return to the initial investment over a specified period of time.

§Arguments

  • rate - The interest rate per period
  • nper - The number of compounding periods
  • pmt - The payment amount per period
  • pv (optional) - The present value, default is 0
  • due (optional) - The timing of the payment (false = end of period, true = beginning of period), default is false (ordinary annuity)

At least one of pmt or pv should be non-zero.

§Returns

  • The future value (FV)

§Example

  • 5% interest rate
  • 10 compounding periods
  • $100 payment per period

use rust_finprim::tvm::fv;

let rate = 0.05; let nper = 10.0; let pmt = -100.0;
fv(rate, nper, pmt, None, None);