I think his problem was that he didn't know how many zeros there would be? i.e. the number could be 1000 with 3 0's or it could be 12400 with two 0's. In which case you wouldn't know to remove 1, 2, or 3 zeros.
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.
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.