Finance Functions: |
|
The FutureValue() function is used to calculate the future value of an investment. The syntax of this function is: Extended __fastcall FutureValue(Extended Rate, int NPeriods, Extended Payment, Extended PresentValue, TPaymentTime PaymentTime); Here is an example: //--------------------------------------------------------------------------- void __fastcall TForm1::btnCalculateClick(TObject *Sender) { Extended Present, Future, Payment, TheRate; int Period; Present = StrToFloat(edtPresent->Text); Payment = StrToFloat(edtPayment->Text); Period = StrToInt(edtPeriod->Text); TheRate = StrToFloat(edtRate->Text) / 12; double Rate = TheRate /100; Future = FutureValue(Rate, Period, Payment, Present, ptEndOfPeriod); edtFuture->Text = FloatToStrF(Future, ffCurrency, 8, 2); } //--------------------------------------------------------------------------- void __fastcall TForm1::btnExitClick(TObject *Sender) { Close(); } //--------------------------------------------------------------------------- |
Home | Copyright © 2004-2016, FunctionX, Inc. | |