[Python Glasgow] converting string reperesenting a number in Scientific notation to int

Hedieh Ebrahimi hedieh.ebrahimi at amphos21.com
Fri May 16 09:21:45 CEST 2014


Thanks a lot.

That worked.


On 15 May 2014 20:48, Ross Young <rossloganyoung at gmail.com> wrote:

> You want to convert it to a float rather than an int.
>
> strNum = "2.00E-03"
>
> float(strNum)
>
> -> 0.002
>
>
> On 15 May 2014 17:39, Hedieh Ebrahimi <hedieh.ebrahimi at amphos21.com>wrote:
>
>> Hi all ,
>>
>> I have a string that shows a number in scientific notation.
>>
>> like this:
>> "2.000E-03"
>>
>> How can I comvert this to an integer so the result would be
>> myIntValue=0.002
>>
>> I need to convert my values and then use them later on in my code.
>>
>> Thanks for your help.
>>
>> _______________________________________________
>> Glasgow mailing list
>> Glasgow at python.org
>> https://mail.python.org/mailman/listinfo/glasgow
>>
>>
>
> _______________________________________________
> Glasgow mailing list
> Glasgow at python.org
> https://mail.python.org/mailman/listinfo/glasgow
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/glasgow/attachments/20140516/20c64d84/attachment.html>


More information about the Glasgow mailing list