[Xfce4-commits] [panel-plugins/xfce4-netload-plugin] 01/02: Only round to 0 digits for KiB/s values (bug #11152)

noreply at xfce.org noreply at xfce.org
Sun Nov 2 15:28:37 CET 2014


This is an automated email from the git hooks/post-receive script.

mmassonnet pushed a commit to branch master
in repository panel-plugins/xfce4-netload-plugin.

commit c7b9a893a3792ca9c6203a27b1fe6c78111b15ac
Author: Mike Massonnet <m8t at gandi.net>
Date:   Sun Nov 2 15:16:25 2014 +0100

    Only round to 0 digits for KiB/s values (bug #11152)
---
 panel-plugin/netload.c |    2 +-
 panel-plugin/utils.c   |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c
index 4fcde53..22b9699 100644
--- a/panel-plugin/netload.c
+++ b/panel-plugin/netload.c
@@ -241,7 +241,7 @@ static gboolean update_monitors(t_global_monitor *global)
             gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(global->monitor->status[i]), temp);
 
         format_byte_humanreadable( buffer[i], BUFSIZ - 1, display[i], 2 );
-        format_byte_humanreadable( buffer_panel[i], BUFSIZ - 1, display[i], 0 );
+        format_byte_humanreadable( buffer_panel[i], BUFSIZ - 1, display[i], 2 );
     }
     
     format_byte_humanreadable( buffer[TOT], BUFSIZ - 1, (display[IN]+display[OUT]), 2 );
diff --git a/panel-plugin/utils.c b/panel-plugin/utils.c
index 30647af..c49744a 100644
--- a/panel-plugin/utils.c
+++ b/panel-plugin/utils.c
@@ -90,8 +90,8 @@ char* format_byte_humanreadable(char* string, int stringsize, double number, int
         digits = 2;
     }
     
-    /* no digits for smallest unit size */
-    if (number <= 1024.0)
+    /* no digits for values under MiB/s unit size */
+    if (number < 1024.0 * 1024.0)
     {
         digits = 0;
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list