ToNumber

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
< [[::Category:Functions|Category:Functions]]

A function added by the Oblivion Script Extender.

Syntax:

(number:float) ToNumber expression:string bIsHex:bool

Takes a string expression and attempts to convert it to a numeric value. By default the string is assumed to be in decimal notation containing digits, at most one decimal point, and an optional leading sign (does not parse commas). If the string is prefixed with "0x" or the optional argument is non-zero, the string is interpreted in hexadecimal notation instead, with valid characters consisting of digits and the letters 'A' through 'F'. Returns 0 if the conversion fails.