Round a decimal number with a certain precision.
1 math.round
<math.round>
<arg /> !
<decimal /> +
</math.round>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Earg | Numeric | Value to round. | |||
Edecimal | Numeric | Decimal number. |
Returns | |
---|---|
Type | Description |
bigdecimal | Value rounded to the specified precision. |
Exceptions
at least 2 arguments required
at least two arguments are required.
illegal operator
Ilegal operator.
illegal object types
Invalid types of argument.
Example
Copy
<xsql-script name='round_sample1'> <body> <set name='arg1' type='decimal'>6.2468</set> --> arg1 = 6.2468 <println> <math.round> <arg1/> 2 </math.round> </println> --> round (arg1, 2) = round (6.2468, 2) = 6.25 </body> </xsql-script>
Returns:
Copy
6.25