File Attributes conversion
Peter Hansen
peter at engcorp.com
Wed Mar 6 19:49:10 EST 2002
John Machin wrote:
>
> 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.
> (-:
Them and, believe it or not, hard drive vendors. Way back
when, one of them must have decided to play dumb and quote
in multiples of 1000000 bytes instead of 1048576, thus
miraculously making their drive seem 4.8% larger than it
really was. Soon after they all followed suit. Now we're
stuck with it.
-Peter
More information about the Python-list
mailing list