{"name":"BIS_fnc_roundDir","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","games":{"tkoh":"1.00","arma3":"0.50"},"since":"tkoh 1.00","arma3_since":"0.50","description":"Round direction to nearest set rounding; used for determining cardinal direction.","syntaxes":[{"syntax":"[rawDirection, rounding] call BIS_fnc_roundDir","params":[{"name":"rawDirection","type":"Number","description":"direction to round","type_expr":"Number"},{"name":"rounding","type":"Number","optional":true,"default":"90","description":"rounding value. With 90° possible return values are 0, 90, 180 and 270","type_expr":"Number","text":"rounding: Number - (Optional, default 90) - rounding value. With 90° possible return values are 0, 90, 180 and 270"}],"returns":{"type":"Number","type_expr":"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":[{"code":["player setDir ([getDir player, 45] call BIS_fnc_roundDir);"]},{"code":["[204.2, 10] call BIS_fnc_roundDir; // will return 200"]},{"code":["[271, 180] call BIS_fnc_roundDir; // will return 360"]},{"code":["70 call BIS_fnc_roundDir; // will return 90"]}],"see_also":["setDir","getRelDir","round"]}