diff options
author | hut <hut@lavabit.com> | 2010-06-25 15:05:55 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-06-25 15:05:55 +0200 |
commit | 643c016cf21dbf8e8dd3ff168ae5c4d0da7b8e9b (patch) | |
tree | dbd88743db8d38c8d0c8a4448aa643c0f340a54a /ranger | |
parent | 40763055c6c1995271acffe6ba5928893940f88b (diff) | |
download | ranger-643c016cf21dbf8e8dd3ff168ae5c4d0da7b8e9b.tar.gz |
ext.human_readable: fixed
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/ext/human_readable.py | 10 |
1 files 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) |