Use SI megabyte (MB) rather than Mebibyte (MiB)
This commit is contained in:
parent
468c7f665d
commit
b672c21bfb
@ -194,7 +194,7 @@ en = {
|
|||||||
"setoffset-msgbox-label" : "Set offset",
|
"setoffset-msgbox-label" : "Set offset",
|
||||||
"offsetinfo-msgbox-label" : "Offset (see http://syncplay.pl/guide/ for usage instructions):",
|
"offsetinfo-msgbox-label" : "Offset (see http://syncplay.pl/guide/ for usage instructions):",
|
||||||
|
|
||||||
"mebibyte-suffix" : " MiB",
|
"megabyte-suffix" : " MB",
|
||||||
|
|
||||||
# Tooltips
|
# Tooltips
|
||||||
|
|
||||||
|
|||||||
@ -97,12 +97,12 @@ def formatSize (bytes, precise=False):
|
|||||||
if bytes == 0: # E.g. when file size privacy is enabled
|
if bytes == 0: # E.g. when file size privacy is enabled
|
||||||
return "???"
|
return "???"
|
||||||
try:
|
try:
|
||||||
mebibytes = int(bytes) / 1048576.0
|
megabytes = int(bytes) / 1000000.0
|
||||||
if precise:
|
if precise:
|
||||||
mebibytes = round(mebibytes, 1)
|
megabytes = round(megabytes, 1)
|
||||||
else:
|
else:
|
||||||
mebibytes = int(mebibytes)
|
megabytes = int(megabytes)
|
||||||
return str(mebibytes) + getMessage("mebibyte-suffix")
|
return str(megabytes) + getMessage("megabyte-suffix")
|
||||||
except: # E.g. when filesize is hashed
|
except: # E.g. when filesize is hashed
|
||||||
return "???"
|
return "???"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user