Flip 8 Directions?!

I can easily make a test to flip a character four different ways (up, down, left, and right) and have it move that way. With the same code, the character may move in eight different directions (up right, up left, down right, etc.). Is there an easy way to flip or rotate the character to match all eight directions without having to create eight different if statements? Thanks in advance =D

—DanDaMan