[PATCH] applets/notifications: never use scientific notation for large numbers
authorNate Graham <nate@kde.org>
Sat, 29 Mar 2025 21:35:36 +0000 (15:35 -0600)
committerAurélien COUDERC <coucouf@debian.org>
Mon, 21 Jul 2025 16:21:10 +0000 (18:21 +0200)
Normal people don't know how to read it.

BUG: 422166
FIXED-IN: 6.4.0

Gbp-Pq: Name upstream_cf206f9d_applets-notifications-never-use-scientific-notation-for-large-numbers.patch

applets/notifications/package/contents/ui/components/JobDetails.qml

index 9c5401c8de02a2304320bb80425e2ffaef6dc409..9995b817556545c6cf052413c6fe4a6b460b365e 100644 (file)
@@ -95,7 +95,10 @@ GridLayout {
             Layout.row: 2 + index
             Layout.fillWidth: true
             text: {
-                var processed = modelInterface.jobDetails["processed" + modelData];
+                let rawProcessed = modelInterface.jobDetails["processed" + modelData];
+                // Format number to not display as exponential
+                processed = rawProcessed.toLocaleString(Qt.locale(), 'f', 0);
+
                 var total = modelInterface.jobDetails["total" + modelData];
 
                 if (processed > 0 || total > 1) {
@@ -103,8 +106,8 @@ GridLayout {
                         switch(modelData) {
                         case "Bytes":
                             return i18ndc("plasma_applet_org.kde.plasma.notifications", "How many bytes have been copied", "%2 of %1",
-                                KCoreAddons.Format.formatByteSize(total),
-                                KCoreAddons.Format.formatByteSize(processed))
+                                KCoreAddons.Format.formatByteSize(total).toLocaleString(Qt.locale(), 'f', 0),
+                                KCoreAddons.Format.formatByteSize(processed)).toLocaleString(Qt.locale(), 'f', 0)
                         case "Files":
                             return i18ndcp("plasma_applet_org.kde.plasma.notifications", "How many files have been copied", "%2 of %1 file", "%2 of %1 files",
                                           total, processed);