Just a small additional remark. It would appear that "%d" is preferable to "%i", based on this extract from perldoc sprintf:
Finally, for backward (and we do mean "backward") compatibility, Perl permits these unnecessary but widely-supported conversions:
%ia synonym for %d
(etc)
So prefer sprintf "%0${int}d" or whatever...
dave
In reply to Re: printf & sprintf: variable number formats
by Not_a_Number
in thread printf & sprintf: variable number formats
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |