Skip to content

Commit 9b79d3a

Browse files
committed
Fix pretty printed file sizes
- Previously any zeros at the end of the number would be stripped, resulting in completely wrong sizes - Bug introduced in 011eab8
1 parent 8d637c9 commit 9b79d3a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,11 @@ def prettyPrintFileSize(fileSizeBytesWithSign):
784784
sign = '-'
785785

786786
if fileSizeBytes >= 1e9:
787-
return "{}{:.1f}".format(sign, fileSizeBytes / 1e9).strip('0').strip('.') + ' GB'
787+
return "{}{:.1f}".format(sign, fileSizeBytes / 1e9) + ' GB'
788788
elif fileSizeBytes >= 1e6:
789-
return "{}{:.0f}".format(sign, fileSizeBytes / 1e6).strip('0').strip('.') + ' MB'
789+
return "{}{:.0f}".format(sign, fileSizeBytes / 1e6) + ' MB'
790790
elif fileSizeBytes > 0:
791-
return "{}{:.0f}".format(sign, fileSizeBytes / 1e3).strip('0').strip('.') + ' KB'
791+
return "{}{:.0f}".format(sign, fileSizeBytes / 1e3) + ' KB'
792792
else:
793793
return "0 KB"
794794

0 commit comments

Comments
 (0)