| ||||||
| 5/29 |
| 2003/5/28 [Computer/SW/Languages/Perl] UID:28569 Activity:nil |
5/27 In Perl, how would I print a number with leading zeros if it's less
than a certain number of digits (eg. I want 3 digits, so '2' = '002')
I can do it an ugly way (have a bunch of 'if length' statements), but
I'm wondering if there's a more elegant way.
\_ printf "03%d",$variable;
\_ always giving it away.... how will they ever learn? |