Val

Converts numeric characters that occur at the beginning of a string to a number.

If conversion fails, returns zero.

Val( value )

Returns: Number

Argument Description
value
string, required

A string or a variable that contains one

Examples

string_number_1 = "1234 Main St.";
string_number_2 = "Main St., 1234";
dump(Val(string_number_1)); // 1234
dump(Val(string_number_2)); // 0

See also