What this function does is it allows you to convert integer to string avoiding exponential representation. In Arma string representation of numbers is rounded to 6 significant figures. Please do read the wiki article, it explains it very well, especially in connection to numbers in Arma. So 6 is the default number for Arma before the number gets turned into something like 1.864e+006. Number of significant figures can be increased to more, which will instantly improve float precision. However there is also engine limit connected to single precision floating point format.

At the moment the default engine number to string conversion of 6 significant figures is lower than allowed precision of the used format, so it can be increased slightly, however while attempting this, developer realised that longer numbers can break some existing layout so it was abandoned. The immediate benefit of the increase in significant figures returned would have been precise map positioning. For example on Altis, because it is huge, top coordinates get rounded to something like 12345.6  <- 6 significant figures in this case, which also means that you can only serialize positions with 10cm precision at the top of the map. Quite bad, right?

I have made a few SQF functions to help with that earlier, however engine solution would have been so much faster. But those functions were for floats. Here is the function for ints. If the int is 7 digits or less long, string representation of it will be the exact number, above 7 digits, some rounding occurs. So here is the function:

KK_fnc_intToString = { _s = ""; while {_this >= 10} do { _this = _this / 10; _s = format ["%1%2", round ((_this % floor _this) * 10), _s]; _this = floor _this; }; format ["%1%2", _this, _s]; };

Examples:

str 123456; //(6) "123456" str 1234567; //(7) "1.23457e+006" 1234567 call KK_fnc_intToString; //(7) "1234567" 1234568 call KK_fnc_intToString; //(7) "1234568" 12345678 call KK_fnc_intToString; //(8) "12345678" 12345677 call KK_fnc_intToString; //(8) "12345678" <- rounding 123456789 call KK_fnc_intToString; //(9) "123456790" <- rounding 123456788 call KK_fnc_intToString; //(9) "123456780" <- rounding

Enjoy,
KK