eric6/Globals/__init__.py

branch
micropython
changeset 7085
328f0f44aa95
parent 6942
2602857055c5
child 7192
a22eee00b052
diff -r 3eddfc540614 -r 328f0f44aa95 eric6/Globals/__init__.py
--- a/eric6/Globals/__init__.py	Fri Jul 26 20:05:49 2019 +0200
+++ b/eric6/Globals/__init__.py	Sat Jul 27 15:40:51 2019 +0200
@@ -446,19 +446,23 @@
     """
     if size < 1024:
         return QCoreApplication.translate(
-            "Globals", "{0:.1f} Bytes").format(size)
+            "Globals", "{0:4.2f} Bytes").format(size)
     elif size < 1024 * 1024:
         size /= 1024
         return QCoreApplication.translate(
-            "Globals", "{0:.1f} KiB").format(size)
+            "Globals", "{0:4.2f} KiB").format(size)
     elif size < 1024 * 1024 * 1024:
         size /= 1024 * 1024
         return QCoreApplication.translate(
-            "Globals", "{0:.2f} MiB").format(size)
-    else:
+            "Globals", "{0:4.2f} MiB").format(size)
+    elif size < 1024 * 1024 * 1024 * 1024:
         size /= 1024 * 1024 * 1024
         return QCoreApplication.translate(
-            "Globals", "{0:.2f} GiB").format(size)
+            "Globals", "{0:4.2f} GiB").format(size)
+    else:
+        size /= 1024 * 1024 * 1024 * 1024
+        return QCoreApplication.translate(
+            "Globals", "{0:4.2f} TiB").format(size)
 
 
 ###############################################################################

eric ide

mercurial