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

Re: Converting Float to SN notation

by kutsu (Priest)
on Mar 24, 2006 at 15:58 UTC ( [id://539054]=note: print w/replies, xml ) Need Help??


in reply to Converting Float to SN notation

Check out the docs for sprintf (or perldoc -f sprintf), as a quick example it could be done like: @nums = qw(3447.097333 0.5); print sprintf("%e", $_), "\n" for @nums

Replies are listed 'Best First'.
Re^2: Converting Float to SN notation
by Anonymous Monk on Mar 24, 2006 at 16:48 UTC
    Thanks...that works great...I just had to adjust the precision: print sprintf("%.10e", $_), "\n" for @nums and it works perfectly.

    Thanks again

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found