round
Rounds a numeric value
Description
The fn:round function is used to round a numeric value to the nearest integer. If the decimal portion of the number is .5 or greater, it is rounded up to the greater whole number (even if its negative), otherwise it is rounded down.
The result type depends the numeric type of the argument. If $arg is untyped, it is cast to xs:double.
Parameters |
Description |
---|---|
arg:numeric() |
Examples
XPath |
Results |
---|---|
round(5) |
5 |
round(5.1) |
5 |
round(5.5) |
6 |
round(-5.5) |
-5 |
round(-5.51) |
-6 |