FUNCTIONS CORE

FV()

Calculate the future value of constant, periodic investments

Syntax

Signature
FV( nInvestment, nInterestRate, nPeriods ) --> nFutureValue

Arguments

nInvestment

nInterestRate

nPeriods

Example

FV.prg
PROCEDURE Main()

   LOCAL nMonthlyRate := 0.06 / 12

   Check( 'Round( FV( 150, nMonthlyRate, 36 ), 2 ) ', Round( FV( 150, nMonthlyRate, 36 ), 2 ), 5900.42 )
   Check( 'FV( 100, 0, 12 )                        ', FV( 100, 0, 12 ), 1200 )

RETURN

STATIC PROCEDURE Check( cTitle, xResult, xExpected )

   QOut( cTitle + IIF( xResult == xExpected, "OK", "ERROR" ) )

RETURN

Output

Round( FV( 150, nMonthlyRate, 36 ), 2 ) OK
FV( 100, 0, 12 )                        OK