compound

Returns the compound interest factor at a rate indicated by rate over a number of periods specified in periods.

This function might be used to calculate the total amount of a loan, by multiplying an original principle by the result of compound.

An error occurs if periods is not a valid integer.

Syntax

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

Return

A string containing the compound interest factor, or an empty string if an error occurs.

Example

In this example, the result of compound is "1.948717". The value of the field is 1.948717 x the amount in the "principleField".

   <field sid="totalAmountField">
      <label>Total Amount of Loan</label>
      <format>
         <datatype>string</datatype>
         <constraints>
            <mandatory>on</mandatory>
         </constraints>
      </format>
      <value compute="principleField.value * &#xA;
         compound('.1', '7')"></value>
   </field>