The round-half-to-even() function performs rounding to a specified number of decimal places. The rounding algorithm used is to round to the nearest value that has the required precision, choosing an even value if two values are equally close. For example, «round-half-to-even(0.035, 2) » returns 0.04 , while «round-half-to-even(4500, -3) » returns 4000 .
Argument | Data Type | Meaning |
---|---|---|
input | Numeric? | The number to be rounded |
precision (optional) | xs:integer | If positive, the number of significant digits required after the decimal point. If negative, the number of zeroes required at the end of the integer part of the result |
Result | Numeric ? | The rounded number. This will have the same data type as the supplied number |