[Baypiggies] scientific notation: string to int

Jeff Sheldon jeff.sheldon at emsense.com
Wed Dec 8 22:39:39 CET 2010

In python 2.6 (and later) float() works for this...

In [15]: float('2.96116E+11')
Out[15]: 296116000000.0

- Jeff

-----Original Message-----
From: baypiggies-bounces+jeff.sheldon=emsense.com at python.org [mailto:baypiggies-bounces+jeff.sheldon=emsense.com at python.org] On Behalf Of Bryce Verdier
Sent: Wednesday, December 08, 2010 1:25 PM
To: Baypiggies
Subject: [Baypiggies] scientific notation: string to int

So I've been given a project for work, a large CSV file with many many 
numbers and such to parse through. The lines that look like this:

b1021384-6633-4756-b3e1-c36d34c1dfd2, clientname_001,Thu Dec  2 00:00:00 
UTC 2010,2.96116E+11,0,0, Thu Dec  2 00:00:00 UTC 2010,577078067

so I'm curious if there is a way to turn the string of scientific notion 
into the actual numerical value?

All ideas are welcomed and thank in advance,

Baypiggies mailing list
Baypiggies at python.org
To change your subscription options or unsubscribe:

This email message is confidential and is intended only for the named recipient(s) above, and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law.  The contents of this email are for discussion purposes only and shall not create a legally binding commitment or agreement of EmSense Corporation, which shall require EmSense Corporation management approval and a formal written agreement signed by both parties.  If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message from your computer.   

More information about the Baypiggies mailing list