in reply to Problems with zero filling a number.

Try re-reading the docs for printf() (which may require reading the docs for sprintf())
printf "%09d", 213; __output__ 000000213

HTH

_________
broquaint