Sv ToNumeric

From GECK
Jump to: navigation, search


A function added by the New Vegas Script Extender.

Description

Attempts to convert the contents of a string variable to a number. Valid characters include digits, a leading sign, and an 'e' to indicate scientific notation. Conversion halts at the first invalid character.

Syntax

[help]
(float) Sv_ToNumeric ToConvert:string_var 

Example

string_var my_string
float MyFloat

let my_string := "-55"

let MyFloat := sv_ToNumeric my_string ; * -55.0

See Also