Numeric Functions

Numeric functions perform rounding, basic conversion, and number-to-string formatting. See also Math Functions for exponential, logarithmic, and trigonometric operations.
abs(-3)3
ceiling(1.1)2
floor(1.9)1
round(1.5)2
round(1.125,2)1.13
round(8452,-2)-8500
round-half-to-even(2.5)2
round-half-to-even(35612.25, -2)35600
number("15")15
format-integer(123,'0000')0123
format-integer(123,'w')one hundred and twenty-three
format-integer(21,'1;o','en')21st
format-integer(14,'Ww;o(-e)','de')Vierzehnte
format-integer(7,'a')g
format-integer(57,'I')LVII
format-integer(1234,'#;##O;')1;234
format-number(12345.6, '#,###.00')12,345.60
format-integer(12345678.9, '9,999.99')12,345,678.90
format-integer(123.9,'9999')0124
format-integer(0.14,'01%')14%
format-integer(-6,'000')-006
format-integer(12.34,'0.000e00')1.234e01
format-integer(12.34,'#.000e0')0.123e2
format-integer(1234.5678, '#;##0*00', 'ch')1;234*57

Values courtesy of http://www.w3.org/TR/2014/REC-xpath-functions-30-20140408/#func-number.


ch03-numeric-functions.xpath.txt:
round(1.125, 2)

1.13