Something wrong with Decimal format

Get help using Construct 2

Post » Thu Feb 13, 2014 10:08 am

Hello,

I've been trying to show only two decimals from a variable.

To do so, I use :   int(NUMBER*100)/100

But it do not work.

Image



And the project file is:

https://www.dropbox.com/s/81gfxs6xxuvzhd3/Decimal-Test.capx

project

Why it do not act as suposed?
B
17
S
4
G
1
Posts: 105
Reputation: 1,874

Post » Thu Feb 13, 2014 10:18 am

change
int((Item8*100)/100)
to
int(Item8*100)/100



Same goes for the entry for item7.


capx
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Thu Feb 13, 2014 10:36 am

True! It works

But why?

It's because with the brackets including the last /100, it turns all into an int number?

Although, the other way turn it into a real number...

This is the reason?

B
17
S
4
G
1
Posts: 105
Reputation: 1,874


Return to How do I....?

Who is online

Users browsing this forum: Fradno, Shenkai the ssj and 28 guests