summaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-18 14:25:25 +0100
committerinfirit <[email protected]>2014-12-18 14:25:25 +0100
commit5a31c0780d1d52e31d07a407f1ea826dbe2a6766 (patch)
tree412eb2caef2b747c512343633756ea8b8bcd7e7d /src/util.cpp
parent32ebc9dbe372feb278080958901f998ef81d5125 (diff)
downloadmate-system-monitor-5a31c0780d1d52e31d07a407f1ea826dbe2a6766.tar.bz2
mate-system-monitor-5a31c0780d1d52e31d07a407f1ea826dbe2a6766.tar.xz
Significant digits format used to remove post decimal wastage on net graph
Taken from GSM commit: 74cfcc81355908075dad0e9f95f195c0d4e2544b From: Conor O'Gorman <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=656841
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util.cpp b/src/util.cpp
index e991347..97119ec 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -167,10 +167,10 @@ procman::format_size(guint64 size, guint64 max_size, bool want_bits)
{ G_GUINT64_CONSTANT(1) << 20, N_("%.1f MiB") },
{ G_GUINT64_CONSTANT(1) << 30, N_("%.1f GiB") },
{ G_GUINT64_CONSTANT(1) << 40, N_("%.1f TiB") } },
- { { G_GUINT64_CONSTANT(1000), N_("%.1f kbit") },
- { G_GUINT64_CONSTANT(1000000), N_("%.1f Mbit") },
- { G_GUINT64_CONSTANT(1000000000), N_("%.1f Gbit") },
- { G_GUINT64_CONSTANT(1000000000000), N_("%.1f Tbit") } }
+ { { G_GUINT64_CONSTANT(1000), N_("%.3g kbit") },
+ { G_GUINT64_CONSTANT(1000000), N_("%.3g Mbit") },
+ { G_GUINT64_CONSTANT(1000000000), N_("%.3g Gbit") },
+ { G_GUINT64_CONSTANT(1000000000000), N_("%.3g Tbit") } }
};
const Format (&formats)[4] = all_formats[want_bits ? 1 : 0];