<div dir="ltr"><br><div>They are being inserted into a database but the db doesn't recognize that as a number.  So I have to convert it to -0.00007800825 before the insert.</div><div><br></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Wed, Jul 23, 2014 at 2:36 PM, Larry Leszczynski <span dir="ltr"><<a href="mailto:larryl@emailplus.org" target="_blank">larryl@emailplus.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Robert -<br>
<div class=""><br>
> OK, I'm parsing through a bunch of data.  Occasionally I get something<br>
> like<br>
> :<br>
> $State="-7.7800825e-05"<br>
><br>
> Usually the "e" is capital ( I don't know why this product logs it this<br>
> way<br>
> ).  When the Capital E goes through the if statements below it converts<br>
> fine, but the lower case does not it seems...<br>
><br>
> I have put in the following sections to convert this:<br>
><br>
>   $State =~ tr/e/E/;<br>
><br>
>   if ( $State =~ /E/ ) {<br>
>     $State2 = sprintf("%.10g", $State);<br>
>     $State=$State2;<br>
>   }<br>
>   if ( $State =~ /e/ ) {<br>
>     $State2 = sprintf("%.10g", $State);<br>
>     $State=$State2;<br>
>   }<br>
<br>
</div>What are you trying to do with these values?  If you use them in numeric<br>
context, they work fine as-is, no matter if they have a "e" or "E":<br>
<br>
$ perl -de 0<br>
<br>
Loading DB routines from <a href="http://perl5db.pl" target="_blank">perl5db.pl</a> version 1.32<br>
Editor support available.<br>
<br>
Enter h or `h h' for help, or `man perldebug' for more help.<br>
<br>
main::(-e:1):   0<br>
  DB<1> print 0 + "-7.7800825e-05"<br>
-7.7800825e-05<br>
  DB<2> print 0 + "-7.7800825E-05"<br>
-7.7800825e-05<br>
<br>
<br>
Larry<br>
_______________________________________________<br>
Denver-pm mailing list<br>
<a href="mailto:Denver-pm@pm.org">Denver-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/denver-pm" target="_blank">http://mail.pm.org/mailman/listinfo/denver-pm</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>:wq!<br>---------------------------------------------------------------------------<br>Robert L. Harris<br><br>DISCLAIMER:<br>      These are MY OPINIONS             With Dreams To Be A King,<br>

       ALONE.  I speak for                      First One Should Be A Man<br>       no-one else.                                     - Manowar
</div>