Help - 2D sprite change from direction

Hello, im trying to make a controller ,where the sprites are changed based on which direction the player is moving to- but I cant figure out the math and animator settings I need to setup for it to work.

My current problem is when rotating from one to other direction works one way, but when going the other, the values of the angle variable do not stay the same(would be a negative number for example)

Any help would be greatly appreciated!

My current way is this:

Vector2 v = rigid.velocity;
   angle = Mathf.Atan2(v.y, v.x) * Mathf.Rad2Deg;

       legAnim.SetFloat("Rotation", angle);

And here is the setup in the animator:

Atan2 returns a 0 to 360 value. Rather than making it expect a negative, why not change your “threshold” values to match your actual expected output of the function?

Actually its using 180 -180 range: