Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: convert output from exponentional notation to normal

by hdb (Prior)
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


Comment on Re: convert output from exponentional notation to normal
Download Code

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 web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2014-12-20 23:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (99 votes), past polls