File Attributes conversion

John Machin sjmachin at lexicon.net
Wed Mar 6 08:03:35 EST 2002


Tim Roberts <timr at probo.com> wrote in message news:<4dhb8u4abe8i9e811lgsi4ejf26fav2jk3 at 4ax.com>...
>   def ShowSize(raw):
>     if raw < 3000:
>       return "%d" % raw
>     elif raw < 2000000:
>       return "%dk" % (raw / 1000)
>     elif raw < 2000000000L:
>       return "%dM" % (raw / 1000000)
>     else:
>       return "%dG" % (raw / 1000000000L)

:-)
I thought only a sales droid would call 1000000 bytes a Mb.
(-:



More information about the Python-list mailing list