as you get digital value you have to extract unit, decade and hundred position values. by dividing and taking remainder . for example
for example if you get 123 you will found following values-
add 0x30 in ar values and print it one by one.
hope this method will work