SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# fn:round-half-to-even

fn:round-half-to-even(numeric? $srcval) → numeric?

Function signature

$srcval | numeric ?
Result | numeric ?

Rounds a numeric value to the nearest whole number, rounding x.5 towards the nearest even number.

XPath 2.0 Specification

fn:round-half-to-even(numeric? $srcval, integer $precision) → numeric?

Function signature

$srcval | numeric ?
$precision | xs:integer
Result | numeric ?

Rounds a numeric value to the nearest integer multiple of 10 the power of minus precision, rounding x.5 towards the nearest number whose last digit is even.

XPath 2.0 Specification

Note:In the case of doubles and floats, rounding errors may occur giving unexpected effects.

Next