ACE3/addons/common/functions/fnc_toNumber.sqf

23 lines
451 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
/*
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 <NUMBER>
2015-09-19 22:55:58 +00:00
*
* Example:
* number = ["102"] call ace_common_fnc_toNumber;
*
* Public: Yes
*/
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