File Attributes conversion

Andreas Kostyrka andreas at mtg.co.at
Tue Mar 12 13:41:45 EST 2002


On 8 Mar 2002 04:06:42 -0800
sam_collett at lycos.co.uk (Sam Collett) wrote:

> How would you remove trailing 0's?
> e.g.
> Instead of 12.20kb it would be 12.2kb
> 23kb instead of 23.00 etc
>>> "%f" % 2.0
'2.000000'
>>> "%.0f" % 2.0
'2'

Andreas




More information about the Python-list mailing list