A algorithm of the number's sequence

Hallo everybody,

I met a problem while I am learning the flash actionscript 2.
The question is how to implement this algorithm: I have number (1-100), however, it will return to 0, when it meets 10, likewise 11 returns to 1, 12 to 2…

90 -> 0
91 -> 1

Thanks in advance!