# Convert Number to Angle?

For questions about using Classic.

### » Sun May 08, 2011 7:30 pm

n-360*floor(n/360) will do the same thing as "%" but preserve floating point numbers.

If you want only a positive angle as a answer:
n-360*floor(n/360) +360*(n<0)
B
97
S
36
G
131
Posts: 5,511
Reputation: 83,460

### » Sun May 08, 2011 7:40 pm

Oh wow, was using windows calc, but I see now that Construct wont accept floats with %.

[quote="R0J0hound":3fu98zmd]n-360*floor(n/360) will do the same thing as "%" but preserve floating point numbers.

If you want only a positive angle as a answer:
n-360*floor(n/360) +360*(n<0)[/quote:3fu98zmd]

heh figured Rojo, or one of the other brains would figure it out.
Guess you could also use int() there too.
450.33-360*int(450.33/360)
B
175
S
50
G
199
Posts: 8,623
Reputation: 124,022

### » Sun May 08, 2011 7:42 pm

Thank you!

That does it.
Follow me on Twitter @evgLabs
B
34
S
14
G
4
Posts: 251
Reputation: 4,074

Previous

Return to Help & Support using Construct Classic

### Who is online

Users browsing this forum: No registered users and 0 guests