[Denver-pm] Scientific Notation -> Dec?????

Robert L. Harris robert.l.harris at gmail.com
Wed Jul 23 13:11:56 PDT 2014


OK, I'm parsing through a bunch of data.  Occasionally I get something like
:
$State="-7.7800825e-05"

Usually the "e" is capital ( I don't know why this product logs it this way
).  When the Capital E goes through the if statements below it converts
fine, but the lower case does not it seems...

I have put in the following sections to convert this:

  $State =~ tr/e/E/;

  if ( $State =~ /E/ ) {
    $State2 = sprintf("%.10g", $State);
    $State=$State2;
  }
  if ( $State =~ /e/ ) {
    $State2 = sprintf("%.10g", $State);
    $State=$State2;
  }


Any ideas?


-- 
:wq!
---------------------------------------------------------------------------
Robert L. Harris

DISCLAIMER:
      These are MY OPINIONS             With Dreams To Be A King,
       ALONE.  I speak for                      First One Should Be A Man
       no-one else.                                     - Manowar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/denver-pm/attachments/20140723/13b763c9/attachment.html>


More information about the Denver-pm mailing list