Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (11)
As of 2018-12-17 14:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (73 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!