From 643c016cf21dbf8e8dd3ff168ae5c4d0da7b8e9b Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 25 Jun 2010 15:05:55 +0200 Subject: ext.human_readable: fixed --- ranger/ext/human_readable.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ranger/ext/human_readable.py b/ranger/ext/human_readable.py index 35dbc35e..40111b6d 100644 --- a/ranger/ext/human_readable.py +++ b/ranger/ext/human_readable.py @@ -28,23 +28,23 @@ def human_readable(byte, seperator=' '): return '0' if byte < 2**10: return '%d%sB' % (byte, seperator) - if byte < 2**10 * 1000: + if byte < 2**10 * 999: return '%.3g%sK' % (byte / 2**10.0, seperator) if byte < 2**20: return '%.4g%sK' % (byte / 2**10.0, seperator) - if byte < 2**20 * 1000: + if byte < 2**20 * 999: return '%.3g%sM' % (byte / 2**20.0, seperator) if byte < 2**30: return '%.4g%sM' % (byte / 2**20.0, seperator) - if byte < 2**30 * 1000: + if byte < 2**30 * 999: return '%.3g%sG' % (byte / 2**30.0, seperator) if byte < 2**40: return '%.4g%sG' % (byte / 2**30.0, seperator) - if byte < 2**40 * 1000: + if byte < 2**40 * 999: return '%.3g%sT' % (byte / 2**40.0, seperator) if byte < 2**50: return '%.4g%sT' % (byte / 2**40.0, seperator) - if byte < 2**50 * 1000: + if byte < 2**50 * 999: return '%.3g%sP' % (byte / 2**50.0, seperator) if byte < 2**60: return '%.4g%sP' % (byte / 2**50.0, seperator) -- cgit 1.4.1-2-gfad0