Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: convert output from exponentional notation to normal

by hdb (Monsignor)
on Mar 19, 2013 at 14:51 UTC ( #1024316=note: print w/replies, xml ) Need Help??


in reply to convert output from exponentional notation to normal

If you want to be more flexible, there is the sprintf function which does the same thing as printf but returns a string. Also, you can put the format into a variable for consistency and flexibility across your program.
$fmt = "%20.18f"; print sprintf( $fmt, 2.19502183680891e-06 )."\n";
For every complex problem there is an answer that is clear, simple, and wrong. H. L. Mencken

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024316]
help
Chatterbox?
and the monastery is silent...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2018-02-22 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (294 votes). Check out past polls.

    Notices?