Returns the number represented in number rounded to the nearest decimal position indicated by place. For example, 100, 10, 1, 0.1, and so on. All numbers are rounded to the right on an x/y graph.
An error occurs if number is not a valid decimal number or place is not a power of 10.
round(number, place)
Parameter | Type | Description |
---|---|---|
number | Decimal number | Any decimal number. |
place | Decimal number | Any decimal number representing the decimal place where number is to be rounded. |
A string containing the rounded number, or an empty parameter if an error occurs.
In this example, the result of round is "323.2400".
<field sid="roundTestField">
<label>Test round()</label>
<format>
<datatype>string</datatype>
<constraints>
<mandatory>on</mandatory>
</constraints>
</format>
<value compute="round('323.235', '.01')"></value>
</field>
In this example, the result of round is "-323.2300".
<field sid="roundTestField">
<label>Test round()</label>
<format>
<datatype>string</datatype>
<constraints>
<mandatory>on</mandatory>
</constraints>
</format>
<value compute="round('-323.235', '.01')"></value>
</field>