Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. /*
  2. Author: Karel Moricky
  3.  
  4. Description:
  5. Convert a number into string (avoiding scientific notation)
  6.  
  7. Parameter(s):
  8. _this: NUMBER
  9.  
  10. Returns:
  11. STRING
  12. */
  13. private ["_number","_mod","_digots","_digitsCount","_modBase","_numberText"];
  14.  
  15. _number = [_this,0,0,[0]] call bis_fnc_param;
  16. _mod = [_this,1,3,[0]] call bis_fnc_param;
  17.  
  18. _digits = _number call bis_fnc_numberDigits;
  19. _digitsCount = count _digits - 1;
  20.  
  21. _modBase = _digitsCount % _mod;
  22. _numberText = "";
  23. {
  24. _numberText = _numberText + str _x;
  25. if ((_foreachindex - _modBase) % (_mod) == 0 && _foreachindex != _digitsCount) then {_numberText = _numberText + ",";};
  26. } foreach _digits;
  27. _numberText
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement