Rounding down to the LOWER integer

Get help using Construct 2

Post » Mon Aug 27, 2012 7:55 pm

As the title says, I'm trying to round down to the [I}lower integer.

Just to be clear; An input of 3.7 would return 3 and NOT 4 as would occur using the round() expression.

Thanks
AVA ROWELL - simplisto.com - @avarowell - add me (simplisto) on Steam!
B
8
S
2
Posts: 23
Reputation: 1,138

Post » Mon Aug 27, 2012 8:09 pm

@simplisto

Use floor(x)
From the Manual: floor(x) Round down x e.g. floor(5.9) = 5

Hint: Check out all the system expressions in the Manual.Velojet2012-08-27 20:15:39
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Mon Aug 27, 2012 8:09 pm

floor(3.7)
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Aug 27, 2012 9:40 pm

You know what? I really felt like I missed out giving the answer to this one. So, I'll just ignore the previous posters

you can use the floor() function. so floor(3.7) would return 3.

Hope I helped.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Mon Aug 27, 2012 9:42 pm

well done sqiddster, good job ;P
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Aug 27, 2012 9:42 pm

What would you do without me?
just sit and cry in the corner I guess...
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Mon Aug 27, 2012 9:43 pm

from now on, you're my personal hero
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Aug 27, 2012 9:47 pm

I should hope so.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Tue Aug 28, 2012 10:02 am

@sqiddster
Sorry for leaping in first (and for going over the top with my reply by including Manual links). In future, if I'm tempted to reply to a thread that you haven't already replied to, I'll send you a PM offering you first right of reply. Velojet2012-08-28 10:03:24
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Tue Aug 28, 2012 10:45 am

That's simple! I can't believe nobody has answered yellow.
Use the floor function.
Eg. floor(3.7) would return a 3. (coincidentally identical example)

Yay for post whoring and overly helpful thread!
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests