From b672c21bfb2063cce28329f9297abbcb36279779 Mon Sep 17 00:00:00 2001 From: Et0h Date: Sat, 25 Oct 2014 13:16:21 +0100 Subject: [PATCH] Use SI megabyte (MB) rather than Mebibyte (MiB) --- syncplay/messages.py | 2 +- syncplay/utils.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/syncplay/messages.py b/syncplay/messages.py index 965cf6d..26992d7 100755 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -194,7 +194,7 @@ en = { "setoffset-msgbox-label" : "Set offset", "offsetinfo-msgbox-label" : "Offset (see http://syncplay.pl/guide/ for usage instructions):", - "mebibyte-suffix" : " MiB", + "megabyte-suffix" : " MB", # Tooltips diff --git a/syncplay/utils.py b/syncplay/utils.py index cf04c2d..b1c52e7 100644 --- a/syncplay/utils.py +++ b/syncplay/utils.py @@ -97,12 +97,12 @@ def formatSize (bytes, precise=False): if bytes == 0: # E.g. when file size privacy is enabled return "???" try: - mebibytes = int(bytes) / 1048576.0 + megabytes = int(bytes) / 1000000.0 if precise: - mebibytes = round(mebibytes, 1) + megabytes = round(megabytes, 1) else: - mebibytes = int(mebibytes) - return str(mebibytes) + getMessage("mebibyte-suffix") + megabytes = int(megabytes) + return str(megabytes) + getMessage("megabyte-suffix") except: # E.g. when filesize is hashed return "???"