taking zeros away
TackyAttack
Member Posts: 141
Is there anyway to take zeros away from a integer,for example, turn 1000 into 1, or 12400 into 124?
Comments
Ex:
In a Display text,
game.number/100
if number was 12400 it would display 124
Hope this helps.
-derek
Off the top of my head i'd say you keep removing 1 zero at a time and do a modulus comparison before the division to see if the remainder is 0 or not. If it's not you know you've reached your limit. Ugly hack, I know there has got to be a prettier math solution. I just woke up.
Divide result by 10
Is there a remainder/modulus?
YES...Multiply by 10 - FINISHED
NO...Loop again.
Come on fellas...give us a hard one!
thanks guys.