ACE3/addons/common/functions/fnc_toNumber.sqf

23 lines
441 B
Plaintext
Raw Normal View History

/*
2015-09-19 22:55:58 +00:00
* Author: Garth de Wet (LH)
* Takes a string/number and returns the number.
*
* Arguments:
* 0: Value to attempt to convert to number or if number simply return number. <STRING, NUMBER>
*
* Return Value:
* <NUMBER>
*
* Example:
* number = ["102"] call ace_common_fnc_toNumber;
*
* Public: Yes
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
2015-09-19 22:55:58 +00:00
params ["_value"];
if (_value isEqualType 0) exitWith {_value};
2015-09-19 22:55:58 +00:00
parseNumber _value // return