Show integer part of a float number.

Get help using Construct 2

Post » Tue Jul 02, 2013 1:02 am

So, i wanna make several actions with some numbers which will give in the end fractional numbers (example: 3,33) but i want it to only show the 3 BUT save the ",33" for later on when i make the same actions with the numbers which will equal 3,33 it sums the previous ,33 giving a final result of 3,66 and so on and on..

Is that possible? Thanks.
B
7
S
1
Posts: 21
Reputation: 647

Post » Tue Jul 02, 2013 1:55 am

int(number) will give you the integer part (3.33 becomes 3)
number - int(number) will give you the decimal part (3.33 becomes 0.33)
B
83
S
22
G
15
Posts: 1,039
Reputation: 15,219

Post » Tue Jul 02, 2013 2:02 am

Thank you, obrigado!

B
7
S
1
Posts: 21
Reputation: 647


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 8 guests