thanks HateR_Kint
I wanted this function to work in 1.46 so i had to make it into an sqs file and then execute it...
this is what i ended up with
_unit = _this select 0
_object = _this select 1
_posA = getpos _unit
_posB = getpos _object
_dir = ((_posB select 0) - (_posA select 0)) atan2 ((_posB select 1) - (_posA select 1))
?_dir < 0: _dir = _dir + 360
_dir = ((_dir + 0.5) - ((_dir + 0.5) % 1))
hint format ["%1",_dir]
exit
this will display the bearing as a whole number