2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
* Transforms a number to an string of the correspondending digits.
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Number to 'digitize' (Number)
|
|
|
|
* 1: Set the minimal length of the returned string. Useful for getting left hand zeroes. (Number, optional)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* Digits. The maximum length is six digits. (String)
|
|
|
|
*/
|
2015-01-12 11:14:15 +00:00
|
|
|
#include "\z\ace\addons\core\script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
private ["_digits", "_count", "_string", "_index"];
|
|
|
|
|
2015-01-11 18:20:14 +00:00
|
|
|
_digits = _this call FUNC(numberToDigits);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_count = count _digits;
|
|
|
|
|
|
|
|
_string = "";
|
|
|
|
for "_index" from 0 to (_count - 1) do {
|
|
|
|
_string = _string + str (_digits select _index);
|
|
|
|
};
|
|
|
|
_string
|