[Baypiggies] scientific notation: string to int

Eric Edens eric.edens at gmail.com
Wed Dec 8 22:52:00 CET 2010


Everything's right; I just didn't know it was built-in :)


On Wed, Dec 8, 2010 at 1:47 PM, Keith Dart <keith at dartworks.biz> wrote:

> === On Wed, 12/08, Eric Edens wrote: ===
> > >>> foo ('2.96116E-11')
> > 2.96116e-11
>
> ===
>
> What's wrong with just:
>
> Python> float('2.96116E+11')
> 296116000000.0
>
> Python> float('2.96116E-11')
> 2.96116e-11
>
> ?
>
>
>
> -- Keith Dart
>
> --
>
> -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   Keith Dart <keith at dartworks.biz>
>   public key: ID: 19017044
>   <http://www.dartworks.biz/>
>   =====================================================================
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20101208/f252a532/attachment.html>


More information about the Baypiggies mailing list