From 4ee67c83481639464294c191da29c45dcbeded7e Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Wed, 17 Aug 2016 10:43:19 +0100 Subject: [PATCH] Moved printing of memory/file sizes to 1KB = 1000B instead of 1KB=1024B --- gprMax/utilities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gprMax/utilities.py b/gprMax/utilities.py index 4ed08e4b..e56053d8 100644 --- a/gprMax/utilities.py +++ b/gprMax/utilities.py @@ -83,7 +83,7 @@ def round_value(value, decimalplaces=0): return rounded -def human_size(size, a_kilobyte_is_1024_bytes=True): +def human_size(size, a_kilobyte_is_1024_bytes=False): """Convert a file size to human-readable form. Args: @@ -103,7 +103,7 @@ def human_size(size, a_kilobyte_is_1024_bytes=True): for suffix in suffixes[multiple]: size /= multiple if size < multiple: - return '{0:.1f}{1}'.format(size, suffix) + return '{:.0f}{}'.format(size, suffix) raise ValueError('Number is too large.')