That's not so hard. First divide your number by 100 and ignore the remainder (easy to do in programming) - there's your 2. Subtract that 2*100 from the number. Then divide by 10 and ignore remainder - there's your 4. Subtract 4*10 and what's left is your 3.
I vaguely remember the first time I figured this out for myself. I puzzled over it for hours. Then it turned out to be pretty easy.
There are fancy, complicated algorithms to do it too, but my simple way works pretty well if you don't need big speed. You're likely doing it for a display, right? No speed needed there.