ParseStringAsNumber

Typestatement
DictionaryLCB
LibraryLiveCode Builder
Syntax
parse <Operand> as number
Associationscom.livecode.arithmetic
Summary

Parses a string as an number

Parameters
NameTypeDescription
Operand

An expression that evaluates to a string.

Example
variable tString as String
put "5.6" into tString
parse tString as number -- the result is 5.6
variable tResult as optional String
variable tNum as optional Number

parse "aaaa" as number into tNum

if tNum is nothing then
	put "unable to parse string" into tResult
end if
Values
NameTypeDescription
The result

Operand parsed as a number, or nothing.

Description

Use ParseStringAsNumber when you want to interpret text numerically. The result is nothing if parsing was not possible.