Converting 5.223701009526849e-05 to 5e-05

Cecil Westerhof Cecil at decebal.nl
Sun May 3 06:02:21 EDT 2015


Op Sunday 3 May 2015 11:51 CEST schreef Chris Angelico:

> On Sun, May 3, 2015 at 7:22 PM, Cecil Westerhof <Cecil at decebal.nl> wrote:
>> Op Sunday 3 May 2015 10:40 CEST schreef Ben Finney:
>>
>>> Cecil Westerhof <Cecil at decebal.nl> writes:
>>>
>>>> When I have a value like 5.223701009526849e-05 in most cases I am
>>>> not interested in all the digest after the dot.
>>>
>>> What type of value is it?
>>
>> If the absolute value is bigger as 0 and smaller as 1, it should be
>> a float. ;-)
>
> Or maybe a fractions.Fraction, or a decimal.Decimal, or a complex,
> or maybe a RXSTRING or a Gmp.mpf! There's more than one way to store
> a number...

Oops. :'-(
I still have to learn a lot.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof



More information about the Python-list mailing list