How do I use random() command but keep only the whole number

Get help using Construct 2

Post » Sat Sep 17, 2016 8:17 pm

Let's say I have the number 11.92 and I want to keep 11 and delete .92 (The number is random every time so I can't just subtract 0.92)

I know this is more of a math question but I could not find the answer on the web =D
ImageImageImageImage
B
27
S
9
G
7
Posts: 229
Reputation: 5,493

Post » Sat Sep 17, 2016 8:59 pm

int(random())
ImageImageImage
B
71
S
21
G
220
Posts: 3,648
Reputation: 123,725

Post » Sat Sep 17, 2016 9:54 pm

I always use floor(random(something)).. :mrgreen:
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Sat Sep 17, 2016 10:27 pm

Thanks guys!
ImageImageImageImage
B
27
S
9
G
7
Posts: 229
Reputation: 5,493


Return to How do I....?

Who is online

Users browsing this forum: davidbox, Mayfly and 5 guests