mantissa and exponent in base 10

C or L Smith smiles at worksmail.net
Fri Oct 8 09:43:02 EDT 2010


Jason Swails wrote:
>> s = ('%%%ig' % sigfigs) % n # double-% cancels the %

Thanks! I see that the parenthesis can be dropped, too:

>>> '%%.%ig' % 3 % 4.23456e-5
'4.23e-05'

/c



More information about the Python-list mailing list