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.
compound(rate, periods)
Parameter | Type | Description |
---|---|---|
rate | Decimal number | The rate of interest in decimal form compounded for each period. |
periods | Integer | The number of periods. |
A string containing the compound interest factor, or an empty string if an error occurs.
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 * 

compound('.1', '7')"></value>
</field>