laziness, impatience, and hubris | |
PerlMonks |
sprintf to zero-pad on the rightby Anonymous Monk |
on Mar 15, 2004 at 16:24 UTC ( [id://336744]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: Newbie sprintf question. I have a string TEST and I want to append zeros so that I have TEST0000. Trying the following yields 0000TEST:
So after reading a bit more, I tried this thinking that the zeros would appear after the string:
But that gives me "TEST " (note the 4 blank spaces instead of zeros). I'm sure I'm missing something obvious. janitored by ybiC: Retitle from "sprintf question" for better search results
Back to
Seekers of Perl Wisdom
|
|