2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-01-11 18:20:14 +00:00
|
|
|
Name: FUNC(toNumber)
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
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:
|
2015-01-11 18:20:14 +00:00
|
|
|
_number = ["102"] call FUNC(toNumber);
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-12 18:22:58 +00:00
|
|
|
#include "\z\ace\addons\common\script_component.hpp"
|
2015-01-12 04:02:33 +00:00
|
|
|
|
|
|
|
if (typeName (_this select 0) == "SCALAR") exitWith {
|
2015-01-11 16:42:31 +00:00
|
|
|
(_this select 0)
|
|
|
|
};
|
|
|
|
|
|
|
|
(parseNumber (_this select 0))
|