ACE3/addons/common/functions/fnc_numberToDigits.sqf

24 lines
613 B
Plaintext
Raw Normal View History

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