Adding Zeros to make it 8 digit

Dear Buddies,
My query may be pretty simple but I am stuck because of it. Please give me a solution.
Query is I have a variable (say $A) which can have any number starting from 1 digit to 8 digit i.e. any number from 1 to 99999999.
Now, I want output as 8 digit even if variable has only 1 digit. IT can be accomplished by addting Zeros (0) before the value of $A.

E.g 1)

$A=1
then output should be printed as 00000001

E.g 2)
$A=1234
then output should be printed as 00001234

E.g. 3)
$A=1234567
then output should be printed as 01234567

E.g 4)
$A=12345678
then output should be printed as 12345678 (As it is because it is already 8 digit number)

$A=1234 . This would be interpreted as a command and not as an assignment.

You could do this:

A=1234
printf "%08d" $A

Or you could also try searching the forum for previous posts of similar kind.

A=1234 
printf "%08d" $A

If you are using ksh93, you can use typeset -Z, i.e.

$ typeset -Z8 var=123
$ echo $var
00000123