http://qs321.pair.com?node_id=539054


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