Inhaltsverzeichnis

Number

The function Number() takes a String 1) and returns a number.
It is possible to convert a string into a certain data type by specifying the data type as a second parameter in order to perform arithmetic operations using XPath.

Typ Description
GInteger
ddouble
DDecimal
fFloat

Syntax:

Number('String')
Number(@Number, 'd')
Number('String', 'Datentyp')
Number('String', 'Datentyp', 'Culture')

Sample:

Code Result Values Type
Number('123', 'G')
123 Integer
Number('10,5', 'd')
10.5 Double
Number('10.5', 'd', '')
10.5 Double 2)
Number('1.000,5', 'd', 'de-de')
1000,5 Double 3)
Number('1,000.5', 'd', 'en-US')
1000,5 Double 4)
1)
The string must necessarily be able to be converted into a numeric value, otherwise the function throws an error.
2)
Read with the InvariantCulture
3)
Read with the German notation
4)
Read with the American notation