There are several ways. I will go through two ways. Pick the one you understand better:
Use math to extract digits:
There is an operation "%" that does this:
125%10=5
http://arduino.cc/en/Reference/ModuloThen you do 125/10, which gives you 12, remember integer math only gives you 12, not 12.5
With 12,
12%10=2
Then 12/10 gives 1,
1%10=1
If you collect all three % results, you get the three digits.
Next method, use text output. It may seem easy to you depending on how comfortable you are with math.
Assume int value=125;
char result[10];
sprintf(result,"%04d",value);
Now result has "0125".
You can do
single=result[3]-'0';
tens=result[2]-'0';
hundreds=result[1]-'0';
thousands=result[0]-'0';
The above assumes up to 9999 positive numbers. Essentially the same math is used inside sprintf.