# How do I Get rid of Decimals

0 favourites
• 11 posts
• Hi have a score system that is bast on how far you come in pixel but that gives me a problem withe decimals

in score is there a way not to diplay decimal?

Thanks

• You mean that you have a number like 100.5? Use action Set text(or what you setting) to floor(ScoreVariable).

• It's called float number, use integer.

int(variable)

floor is not integral, it' s opposite of round.

• It's called float number, use integer.

int(variable)

floor is not integral, it' s opposite of round.

I was so hurry that just write first that comes to mind

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Actually, it's opposite of ceil, not round, floor does round a number downward to its nearest integer.

• Actually, it's opposite of ceil, not round, floor does round a number downward to its nearest integer.

I can't see a real difference between floor and int in that case. int(100.9995) and floor(100.9995) are still 100. So floor can be used too.

• In this example is the same but int() and floor() are quite different. For example:

floor(-10.7) = -11

int(-10.7) = -10

• In this example is the same but int() and floor() are quite different. For example:

floor(-10.7) = -11

int(-10.7) = -10

Sure, i'm not saying that they are the same, but if op use them for displaying score, that is frequently greater than 0, he can choose between them.

• Yeah but what if at some point, op will need some negative values?

Now he knows the difference

• Yeah but what if at some point, op will need some negative values?

Now he knows the difference

If so, then he got to use int for sure.

• Thanks workt fine

• 11 posts