Skip to content

Commit

Permalink
Issue #2741 - Change unit size to 1000 instead of 1024 (#2742)
Browse files Browse the repository at this point in the history
* Issue #2741 - Change unit size to 1000 instead of 1024

* Issue #2741 Apply pycodestyle on changes
  • Loading branch information
rukgar authored and memsharded committed Apr 11, 2018
1 parent 02e0e17 commit ac25c89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions conans/client/tools/files.py
Expand Up @@ -13,6 +13,8 @@

_global_output = None

UNIT_SIZE = 1000.0


@contextmanager
def chdir(newdir):
Expand All @@ -35,9 +37,9 @@ def human_size(size_bytes):

num = float(size_bytes)
for suffix, precision in suffixes_table:
if num < 1024.0:
if num < UNIT_SIZE:
break
num /= 1024.0
num /= UNIT_SIZE

if precision == 0:
formatted_size = "%d" % num
Expand Down

0 comments on commit ac25c89

Please sign in to comment.