Function rust_finprim::tvm::fv
source · pub fn fv(
rate: Decimal,
nper: Decimal,
pmt: Decimal,
pv: Option<Decimal>,
due: Option<bool>
) -> Decimal
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 periodnper
- The number of compounding periodspmt
- The payment amount per periodpv
(optional) - The present value, default is 0due
(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;
use rust_decimal_macros::*;
let rate = dec!(0.05); let nper = dec!(10); let pmt = dec!(-100);
fv(rate, nper, pmt, None, None);