ACE3/addons/common/functions/fnc_toNumber.sqf
2015-05-14 17:12:40 -05:00

25 lines
452 B
Plaintext

/*
Name: FUNC(toNumber)
Author(s):
Garth de Wet (LH)
Description:
Takes a string/number and returns the number.
Parameters:
0: TYPE - Value to attempt to convert to number or if number simply return number.
Returns:
NUMBER
Example:
number = ["102"] call FUNC(toNumber);
*/
#include "script_component.hpp"
if (typeName (_this select 0) == "SCALAR") exitWith {
(_this select 0)
};
(parseNumber (_this select 0))