Top  | Previous | Next

Type Casting / toLong

toLong(value, [failover])

Tries to coerce value into a long (64-bit integer). If value is a number, the conversion is direct. If value is a string, it is parsed to see if it represents a long. If not, type casting fails. Will round if appropriate.

 

toLong("38")

... returns 38

 

toLong("33.9")

... returns 34

 

toLong({Root Container.TextField.text}, -1)

... returns the value in the text box as an long, or -1 if the value doesn't represent an number.