Returns the modulus of the number represented in number using the divisor indicated by divisor.
An error occurs if either of number or divisor is not a valid decimal number, or ifdivisoris 0.
mod(number, divisor)
Parameter | Type | Description |
---|---|---|
number | Decimal number | Any decimal number. |
periods | Decimal number | Any decimal number except zero (0) representing the divisor for which the modulus will be computed. |
A string containing the modulus, or an empty string if an error occurs.
In this example, the result of mod is "-0.200000".
<field sid="modTestField">
<label>Test mod()</label>
<format>
<datatype>string</datatype>
<constraints>
<mandatory>on</mandatory>
</constraints>
</format>
<value compute="mod('-3.5', '.3')"></value>
</field>