Converts a numeric string in local format (representable by the user) to machine format dependibg of the indicated language, country and variant.

1 number.parse

<number.parse
    lang='lang'
    country='country'
    variant='variant'
>
    <value /> !
</number.parse>

Exceptions

requires 1 arguments, received: 0

The function needs a entry value.

Unparseable number: "..."

The value passed to the function is impossible to parse, because it contains no numeric characters differents to the comma ',' and the point '.' ..

Example

Conversion of strings which represents numbers, in decimal format, with european and anglo-saxon decimal separator.

Copy
<xsql-script name='number_parse'>
    <body>
        <!-- Converts the string 1,2 to a number in german language 1.2      -->
        <!-- The comma is interpreted in german as decimal separator.        -->
        <println><number.parse lang='de'><string>1,2</string></number.parse></println>

        <!-- Converts the string 193837.0932 to a number in german language 1938370932 -->
        <!-- The point is interpreted in german as the thousands separator.            -->
        <println><number.parse lang='de'><string>193837.0932</string></number.parse></println>

        <!-- Converts the string 1,2 to a number in english language 12      -->
        <!-- The comma is interpreted in english as the thousands separator. -->
        <println><number.parse lang='en'><string>1,2</string></number.parse></println>

        <!-- Converts the string 193837.0932 to a number in english language 193837.0932 -->
        <!-- The point is interpreted in english as the decimal separator.               -->
        <println><number.parse lang='en'><string>193837.0932</string></number.parse></println>
    </body>
</xsql-script>

Returns:

Copy
1.2
1938370932
12
193837.0932