From 3fa3e8510a355902f6b772cabb1a9f21c695f516 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Sat, 29 Mar 2025 15:35:36 -0600 Subject: [PATCH] [PATCH] applets/notifications: never use scientific notation for large numbers 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 --- .../package/contents/ui/components/JobDetails.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/applets/notifications/package/contents/ui/components/JobDetails.qml b/applets/notifications/package/contents/ui/components/JobDetails.qml index 9c5401c8..9995b817 100644 --- a/applets/notifications/package/contents/ui/components/JobDetails.qml +++ b/applets/notifications/package/contents/ui/components/JobDetails.qml @@ -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); -- 2.30.2