# Angles in Degrees

Get help using Construct 2

### » Sun Nov 16, 2014 11:48 pm

Anybody know of a quick way to have an angle displayed as a degree, rather than a minus.

By degree, I mean an arrow facing directly up would be 270, rather than -90. This also means that if an object rotates completely 10 times, rather than returning a result of 3600, I can instead be presented with a 0. So 0 and 360 are exactly the same, and if an object rotates anti-clockwise a single degree, I'll see 359 rather than -1.

B
94
S
18
G
8
Posts: 1,026
Reputation: 12,378

### » Mon Nov 17, 2014 12:19 am

This will work where your angle is coming from the angle expression. Where X is your angle and -180 <= X <= 180, using a conditional expression.

Code: Select all
`NiceAngle = X > 0 ? X : 360 + X`

Which translates equivalently to the statement(not usable, this is just for demonstration purposes):

Code: Select all
`NiceAngle = X if X > 0 else (360 + X)`
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,136

### » Mon Nov 17, 2014 12:42 am

Great! I'll give it a go first thing in the morning! I rarely use conditional expressions like this (if ever, thinking about it), so I'll do my best to get this sorted.
B
94
S
18
G
8
Posts: 1,026
Reputation: 12,378