ACE3/addons/common/functions/fnc_numberToDigits.sqf
SilentSpike 33e25535c9
Deprecate common function numberToDigitsString (#6007)
* Deprecate common function numberToDigitsString
2018-01-02 17:00:01 +00:00

24 lines
605 B
Plaintext

/*
* Author: commy2, SilentSpike
* Transforms a number to an array of the correspondending digits.
*
* Arguments:
* 0: Number to 'digitize' <NUMBER>
* 1: Set the minimal length of the returned array. Useful for getting left hand zeroes. <NUMBER>, optional
*
* Return Value:
* Digits. The maximum count is six digits. <ARRAY>
*
* Example:
* [5, 5] call ace_common_fnc_numberToDigits
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_number", "_minLength"];
_number = [_number min 999999, _minLength] call CBA_fnc_formatNumber;
(_number splitString "") apply { parseNumber _x }