Name

round( ) — returns the integer closest to the num parameter

Synopsis

Defined in: XPath 1.0
Parameters: number num (required)
Return type: number

In the event of a tie, the larger result is returned. NaN, Infinity, and -Infinity are passed through unchanged.

The first example returns 4. The second example returns -3.

round(3.5)
round(-3.5)

Get XForms Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.