Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Using (s)printf()

by RichardK (Parson)
on Aug 31, 2016 at 18:03 UTC ( #1170912=note: print w/replies, xml ) Need Help??


in reply to Re: Using (s)printf()
in thread Using (s)printf()

Try this

perl -E 'printf("%12.4f\n",12.34)'

gives

>     12.3400

see the docs for sprintf for much more detail :) but in brief it's "%<length>.<dp>f"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1170912]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2017-11-18 03:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?