src/eric7/Globals/__init__.py

branch
server
changeset 10539
4274f189ff78
parent 10439
21c28b0f9e41
child 10806
2f6df822e3b9
--- a/src/eric7/Globals/__init__.py	Mon Jan 29 19:50:44 2024 +0100
+++ b/src/eric7/Globals/__init__.py	Fri Feb 02 11:29:08 2024 +0100
@@ -197,7 +197,7 @@
     """
     if loc is None:
         if size < 1024:
-            return QCoreApplication.translate("Globals", "{0:4.2f} Bytes").format(size)
+            return QCoreApplication.translate("Globals", "{0:4d} Bytes").format(size)
         elif size < 1024 * 1024:
             size /= 1024
             return QCoreApplication.translate("Globals", "{0:4.2f} KiB").format(size)
@@ -211,9 +211,12 @@
             size /= 1024 * 1024 * 1024 * 1024
             return QCoreApplication.translate("Globals", "{0:4.2f} TiB").format(size)
     else:
+        if not isinstance(size, float):
+            size = float(size)
+
         if size < 1024:
             return QCoreApplication.translate("Globals", "{0} Bytes").format(
-                loc.toString(size, "f", 2)
+                loc.toString(size)
             )
         elif size < 1024 * 1024:
             size /= 1024

eric ide

mercurial