Obtain the lowest integer value that is higher than the argument value (rounding up). Optionally, allows to indicate a rounding precision
at decimals level.
1 math.ceiling
<math.ceiling>
<arg /> !
<decimals /> *
</math.ceiling>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Earg | Numeric | Value to round. | |||
Edecimals | Numeric | Number of decimals. |
Returns | |
---|---|
Type | Description |
Bigdecimal | Natural number. |
Exceptions
too many arguments for ceiling function
Too many arguments passed to the function.
Example
Copy
<xsql-script name='ceiling_sample1'> <body> <println> <math.ceiling>0.3</math.ceiling> </println> --> ceiling (0.3) = 1 </body> </xsql-script>
Rounding up the number 0.3, is 1.
Example
Copy
<xsql-script name='ceiling_sample2'> <body> <set name='a'>0.819</set> <println> <math.ceiling><a/></math.ceiling> </println> --> ceiling (a) = ceiling (0.819) = 1 </body> </xsql-script>
Rounding up the content of the variable a, which is the number 0.819, is 1.
Example
Copy
<xsql-script name='ceiling_sample3'> <body> <set name='a'>0.819</set> <println> <math.ceiling> <a/> 2 </math.ceiling> </println> </body> --> ceiling (a, 2) = ceiling (0.819, 2) = 0.82 </xsql-script>
Rounding up the content of the variable a, with a precision of 2 decimals is 0.82.
Example
Copy
<xsql-script name='ceiling_sample4'> <body> <set name='a'>0.819</set> <println> <math.ceiling> <a/> 4 </math.ceiling> </println> --> ceiling (a, 4) = ceiling (0.819, 4) = 0.8190 </body> </xsql-script>
Rounding up the content of the variable a, with a precision of 4 decimals, is 0.8190.
Example
Copy
<xsql-script name='ceiling_sample5'> <body> <set name='a'>0.819</set> <println> <math.ceiling> <a/> 0 </math.ceiling> </println> --> ceiling (a, 0) = ceiling (0.819, 0) = 1 </body> </xsql-script>
Rounding up the content of the variable a. with a precision of 0 decimals, is 1.