annuity

Returns the present valueannuity factor for an ordinary annuity, at a periodic interest rate indicated by rate over a number of periods specified in periods. Present value is the lump sum to invest at rate to produce a set payment over periods. An ordinary annuity provides the payment at the end of each period specified in periods.

This function might be used to figure out either:

For reference:

An error occurs if periods is not a valid integer, or if rate is 0.

Syntax

   annuity(rate, periods)
Table 1. annuity parameters
Parameter Type Description
rate Decimal number The rate of interest in decimal form compounded for each period.
periods Integer The number of periods.

Returns

A string containing the present value annuity factor, or null if an error occurs.

Example

In this example, annuity returns "5.786373" and, if the desired payment entered into "paymentField" were $1, then the value of "presentValueInv" would be $5.78. That is, a person would have to invest $5.78 at 5% for seven payments.

   <field sid="presentValueInv">
      <label>The present value to invest is:</label>
      <format>
         <datatype>string</datatype>
         <constraints>
            <mandatory>on</mandatory>
         </constraints>
      </format>
      <value compute="paymentField.value * &#xA;
         annuity('.05', '7')"></value>
   </field>