mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
28 lines
579 B
Plaintext
28 lines
579 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
* Converts a number to a string without losing as much precission as str or format.
|
|
*
|
|
* Arguments:
|
|
* 0: A number <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* The number as string <STRING>
|
|
*
|
|
* Example:
|
|
* [5] call ace_common_fnc_numberToString
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params ["_number"];
|
|
|
|
private _decimals = str (abs _number mod 1);
|
|
_decimals = toArray _decimals;
|
|
_decimals deleteAt 0;
|
|
|
|
if (_number < 0) exitWith {
|
|
format ["-%1%2", floor abs _number, toString _decimals];
|
|
};
|
|
format ["%1%2", floor _number, toString _decimals];
|