{"name":"BIS_fnc_roundDir","operator":null,"title":"BIS fnc roundDir","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_roundDir","revid":327918,"updated":"2022-07-13T12:12:29Z","groups":["Math"],"status":"ok","replaced_by":[],"games":[{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Round direction to nearest set rounding; used for determining cardinal direction.","syntaxes":[{"syntax":"[rawDirection, rounding] call BIS_fnc_roundDir","since":null,"effect":null,"exec":null,"params":[{"name":"rawDirection","type":"Number","optional":false,"default":null,"description":"direction to round","types":["Number"],"since":null,"text":"rawDirection: Number - direction to round"},{"name":"rounding","type":"Number","optional":true,"default":"90","description":"rounding value. With 90° possible return values are 0, 90, 180 and 270","types":["Number"],"since":null,"text":"rounding: Number - (Optional, default 90) - rounding value. With 90° possible return values are 0, 90, 180 and 270"}],"returns":{"type":"Number","types":["Number"],"description":"rounded direction, depending on input. Can be negative or over 360","text":"Number - rounded direction, depending on input. **Can be negative or over 360**"}}],"examples":[{"text":"```sqf\nplayer setDir ([getDir player, 45] call BIS_fnc_roundDir);\n```","code":["player setDir ([getDir player, 45] call BIS_fnc_roundDir);"]},{"text":"```sqf\n[204.2, 10] call BIS_fnc_roundDir; // will return 200\n```","code":["[204.2, 10] call BIS_fnc_roundDir; // will return 200"]},{"text":"```sqf\n[271, 180] call BIS_fnc_roundDir; // will return 360\n```","code":["[271, 180] call BIS_fnc_roundDir; // will return 360"]},{"text":"```sqf\n70 call BIS_fnc_roundDir; // will return 90\n```","code":["70 call BIS_fnc_roundDir; // will return 90"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["setDir","getRelDir","round"],"notes":[],"categories":["Arma 3: Functions","Function Group: Math","Functions","Introduced with Take On Helicopters version 1.00","Take On Helicopters: Functions","Take On Helicopters: New Functions"],"docblock":null,"filled_from_docblock":[]}