The number() function converts its argument to a number. Any value can be converted to a number using the following rules:
Datatype
Conversion Rules
Number
Value is unchanged.
String
If after leading and trailing whitespace is removed, all that is left is an optional minus sign followed by an XPath Number, it is evaluated as an XPath expression. Otherwise it is NaN.
Boolean
False becomes 0, true becomes 1.
Node-set
The node is first converted to a string using the rules of the string () function and is then evaluated as a string. Only the first node in a set is converted and evaluated.
Syntax:
number number(value[optional])
Arguments:
A value of any XSLT/XPath supported datatype. If no argument is specified, the function uses the string value of the context node.