How to round rotation angle up or down?

The player is able to push the object in the direction of the player controller which works fine.

I want the object to move along the x and y axes only though. For that I’d have to round the angle up or down ( to the next 0, 90 or -90 degrees).

How can I do that? I looked a bit into floor and ceil but will they work for me here?