Function fv

  • Compute the future value.

    Parameters

    • rate: number

      Rate of interest as decimal (not per cent) per period

    • nper: number

      Number of compounding periods

    • pmt: number

      A fixed payment, paid either at the beginning or ar the end (specified by when)

    • pv: number

      Present value

    • when: PaymentDueTime = PaymentDueTime.End

      When payment was made

    Returns number

    The value at the end of the nper periods

    Since

    v0.0.12

    Examples

    What is the future value after 10 years of saving $100 now, with an additional monthly savings of $100. Assume the interest rate is 5% (annually) compounded monthly?

    import { fv } from 'financial'

    fv(0.05 / 12, 10 * 12, -100, -100) // 15692.928894335748

    By convention, the negative sign represents cash flow out (i.e. money not available today). Thus, saving $100 a month at 5% annual interest leads to $15,692.93 available to spend in 10 years.

    Notes

    The future value is computed by solving the equation:

    fv + pv * (1+rate) ** nper + pmt * (1 + rate * when) / rate * ((1 + rate) ** nper - 1) == 0
    

    or, when rate == 0:

    fv + pv + pmt * nper == 0
    

    References

    Wheeler, D. A., E. Rathke, and R. Weir (Eds.) (2009, May).

Generated using TypeDoc