How do I make a round number?

Get help using Construct 2

Post » Sun Jan 15, 2017 1:14 pm

Greetings there!! ^_^
So i am currently experimenting with damage which comes from stats + weapons, and then display it in text.
However depending on the damage, sometimes its ''25.7'' or ''25.9'' - now is there a way to make the
number display to round up? Like 25.7 should be 26. And so on.

Since the damage scales in % wise, the decimals keep happening.
B
12
S
3
Posts: 164
Reputation: 1,530

Post » Sun Jan 15, 2017 1:49 pm

Use ceil() to round up, floor() to round down and int() to round to nearest.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 242
Reputation: 2,306

Post » Sun Jan 15, 2017 6:21 pm

^^^ round(x) to round to nearest
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: FabianB, ST314 and 32 guests