From 5b97c377b7a99036397a7815ed60a3058e2eb875 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Wed, 7 Apr 2004 14:23:30 +0000 Subject: [PATCH] Make size_type use MB/KB/B and use 1024 based sizes --- utils.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/utils.py b/utils.py index 1ad6a4e7..0dea7de1 100644 --- a/utils.py +++ b/utils.py @@ -2,7 +2,7 @@ # Utility functions # Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup -# $Id: utils.py,v 1.66 2004-04-03 02:49:46 troup Exp $ +# $Id: utils.py,v 1.67 2004-04-07 14:23:30 dsilvers Exp $ ################################################################################ @@ -499,13 +499,13 @@ def whoami (): ################################################################################ def size_type (c): - t = " b"; - if c > 10000: - c = c / 1000; - t = " Kb"; - if c > 10000: - c = c / 1000; - t = " Mb"; + t = " B"; + if c > 10240: + c = c / 1024; + t = " KB"; + if c > 10240: + c = c / 1024; + t = " MB"; return ("%d%s" % (c, t)) ################################################################################ -- 2.39.5