Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: sprintf formatting doubt

by matija (Priest)
on Feb 11, 2005 at 08:10 UTC ( #430014=note: print w/ replies, xml ) Need Help??


in reply to sprintf formatting doubt

You could just use the standard printf sintax, and write sprintf "%0*d",$dig,$inc; Here is an example:

perl -e '$a=150; $b=6; print sprintf "%0*d\n",$b,$a;' 000150


Comment on Re: sprintf formatting doubt
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://430014]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2014-09-18 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (101 votes), past polls