convert int to string and then...

but division and modulo will be faster.
Code:

I was kind of thinking of modulo, but WOW thanks for jelling my thought! Your example looks good. Thanks.