incoming pseudocode
if level < 10
display 0 in the tens spot
if level == 1
display 1 in the ones spot
[if level == 2,3,4,5,6,7,8,9 obviously]
else
if level % 10 == 1
display 1 in the tens spot
if level - 10 == 1
display 1 in the ones spot
[if level - 10 == 2,3,4,5,6,7,8,9 obviously]
else
if level % 10 == 2
[etc...]
might not be the best way and I just came up with it off the top of my head
but that could work.
do you get the idea I was trying to give you?