ToNumber

From the Oblivion ConstructionSet Wiki
Revision as of 17:33, 27 January 2017 by imported>Malachy1681
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.