Name

string:try-parse-number

Usage

builtin-function

Syntax

(string:try-parse-number str &key (base 10) (decimal-point-is-comma false) culture)

Description

Converts a string to a number. The parameters base and decimal-point-is-comma have precedence over culture.

user 1 > (.try-parse-number "123.4" )
it: 123.4
user 2 > (.try-parse-number "123,4" :decimal-point-is-comma true)
it: 123.4
user 3 > (.try-parse-number "123a" )
it: null
user 4 > (.try-parse-number "123a" :base 16 )
it: 4666