How can you round to two decimal places?
asdfGames
Member Posts: 15
I have a shooter game and I am calculating accuracy. I have a display function, with it displaying "game.hits/game.shots". However, it goes to six decimal places, which I don't wish to display. I've tried the floor function, but that just rounds it down to zero. Thanks guys
Best Answers
-
Socks London, UK.Posts: 12,822This works up to a certain point:
floor(AAA*100)/100
. . . . . . . . . . . . . . .
If AAA = 55.123456
* 100 = 5512.3456
floor (5512.3456) = 5512
5512/100 = 55.12
-
tenrdrmer Posts: 9,934you could just use the built in Function designed for this
http://cookbook.gamesalad.com/definitions#precision-function
Answers