From c752b7775a5f027a6fbec3f29dcff661b2620efa Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 3 Nov 2013 14:47:10 +0100 Subject: [PATCH] [entropy.tools] 1kB is 1000 bytes --- lib/entropy/tools.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/entropy/tools.py b/lib/entropy/tools.py index f7e84773c..9501aadfb 100644 --- a/lib/entropy/tools.py +++ b/lib/entropy/tools.py @@ -2168,13 +2168,13 @@ def bytes_into_human(xbytes): @return: number of bytes in human readable format @rtype: string """ - size = str(round(float(xbytes)/1024, 1)) - if xbytes < 1024: + size = str(round(float(xbytes) / 1000, 1)) + if xbytes < 1000: size = str(round(float(xbytes)))+"b" - elif xbytes < 1023999: + elif xbytes < 1000000: size += "kB" - elif xbytes > 1023999: - size = str(round(float(size)/1024, 1)) + elif xbytes >= 1000000: + size = str(round(float(size)/1000, 1)) size += "MB" return size