variable length of integer



Dear friends,
in a output format specification is given like ,say "format (i5)"
which means, upto 99999 will be written and if the integer is less
then 5 digit, it will be trailed by blanck, like "**999".

Is there any way to write format specification so that it will
automatically adjust the length? so even if the integer is of 3 digit,
it will not be trailed by the blanks?
.