Kiku_TheDog 10 Posted May 7, 2014 im sorry cause my english is really bad. i need to round numbers like 0.046 to 0.05 or 1.234 to 1.23. my friend and i we are making something like a firingdrill and we want to get the shooting times like that. we are using the eventhandler fire, and just needed to round the number of the time. i couldnt find any info about that, may be is my english fault. Thank you mates! and let me know if you need an example of what we are making to work around.:confused: Share this post Link to post Share on other sites
Väinämöinen 0 Posted May 7, 2014 Hi! You should check this out: https://community.bistudio.com/wiki/round And don't forget the floor and the ceil commands! regards.Väinämöinen Share this post Link to post Share on other sites
champ-1 40 Posted May 7, 2014 Something like this maybe (round (1,234 * 100)) / 100 Share this post Link to post Share on other sites
Kiku_TheDog 10 Posted May 9, 2014 hi mates and thank you for your answer. thats what i finally did. in the trigger that activate the firing drill: { _x addEventHandler ["Fired", {_this execVM "prueba.sqf";}];} forEach T_Players; comienzaRonda = diag_tickTime; being T_Players all the players. in the prueba.sqf file: _unitfired = _this select 0; _ammo = _this select 4; _projectile = _this select 6; _nonvalid = ["DemoCharge_Remote_Ammo"]; if (!(_ammo in _nonvalid)) then { _tiro = diag_tickTime; _tiempoTiro = (_tiro - comienzaRonda); _tiempoTiroMulti = (_tiempoTiro * 100); _tiempoTiroRedondeo = round _tiempoTiroMulti; _tiempoTiroFinal = (_tiempoTiroRedondeo / 100); hint format["Number %1", _tiempoTiroFinal]; }; i´ve just tested it and it works to me, i don´t know if it would do the job in a server. any idea to improve it? ill aprecciate any advice, and ty again mates!! i use spanish to call my variables, to make it easy to understand to my friends, sorry for that :p Share this post Link to post Share on other sites