Integer Question and Using "floor"
![dazzleme](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
I'm trying to get the decimal values in my score to NOT appear. I've set up two associated attributes in my game, both are integers, as shown here:
Attributes:
Score
NewScore
"NewScore" is the score I have showing on the screen, it takes the value of "Score" and interpolates it so that the numbers count up to the value of score. This is the rule that I use:
When Attribute "game.NewScore" < "game.Score"
Interpolate Attribute "game.NewScore" to "game.Score"
This works great except that as "NewScore" is counting up, it shows a decimal out to the hundredths. I've been searching the forums and looking at tutorials and understand that one needs to use the "floor" expression to get rid of the decimals. I'm stuck at *where* to use floor, and the math to use with floor. I've seen several different examples none of which have brought me any results.
Based on the information I've provided, would anyone be able to help me with some guidance/math around "floor"?
Attributes:
Score
NewScore
"NewScore" is the score I have showing on the screen, it takes the value of "Score" and interpolates it so that the numbers count up to the value of score. This is the rule that I use:
When Attribute "game.NewScore" < "game.Score"
Interpolate Attribute "game.NewScore" to "game.Score"
This works great except that as "NewScore" is counting up, it shows a decimal out to the hundredths. I've been searching the forums and looking at tutorials and understand that one needs to use the "floor" expression to get rid of the decimals. I'm stuck at *where* to use floor, and the math to use with floor. I've seen several different examples none of which have brought me any results.
Based on the information I've provided, would anyone be able to help me with some guidance/math around "floor"?
Comments
For anyone else who stumbles upon this post looking for the same answer, what really surprised me most was that it wasn't to the "interpolate attribute" rule that "floor" was placed. I applied it to the "Display Text" behavior. Go figure, but it makes sense now that I think about it.