mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Make function handle negative numbers
This commit is contained in:
parent
c1799616c7
commit
04e9f28734
@ -15,9 +15,11 @@ private ["_number", "_decimals"];
|
||||
|
||||
_number = _this select 0;
|
||||
|
||||
_decimals = str (_number mod 1);
|
||||
|
||||
_decimals = str (abs(_number) mod 1);
|
||||
_decimals = toArray _decimals;
|
||||
_decimals deleteRange [0,2];
|
||||
_decimals deleteAt 0;
|
||||
|
||||
format ["%1.%2", floor _number, toString _decimals];
|
||||
if (_number < 0) exitWith {
|
||||
format ["-%1%2", floor abs(_number), toString _decimals];
|
||||
};
|
||||
format ["%1%2", floor _number, toString _decimals];
|
||||
|
Loading…
Reference in New Issue
Block a user