Don't ask to ask, just ask | |
PerlMonks |
(tye)Re: front-pad a number with zero'sby tye (Sage) |
on Oct 31, 2001 at 00:18 UTC ( [id://122188]=note: print w/replies, xml ) | Need Help?? |
To both pad short values and (left)truncate long ones: $str= substr("0"x$len.$str,-$len); is another WTDI. - tye (but my friends call me "Tye")
In Section
Cool Uses for Perl
|
|