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
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to