Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Converting Float to SN notation

by kutsu (Priest)
on Mar 24, 2006 at 15:58 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://539054]
hippo looks sideways at LiposuctionAnnCure
[Veltro]: I don't understand. I keep getting "your connection is not secure" on https://perlmonks. org. The behaviour is totally random. Then it is insecure and then it is secure again...
[marto]: Re: Monastery login over http

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2018-05-23 11:19 GMT
Find Nodes?
    Voting Booth?