Here is the formula to get the angle in 0-360 degrees range:
a=(Player.8Direction.MovingAngle+360)%360
If you want to have just one formula, I guess you can do something like this to get numeric value 0-3 for player direction:
d = (a>315 | a<=45) ? 0 : (a>45 & a<=135) ? 1 : (a>135 & a<=225) ? 2 : 3
Then set animation frame to d.
Or you can name your animations "A0", "A1", "A2", "A3" and set animation to "A" & d