From c7b9a893a3792ca9c6203a27b1fe6c78111b15ac Mon Sep 17 00:00:00 2001 From: Mike Massonnet Date: Sun, 2 Nov 2014 15:16:25 +0100 Subject: [PATCH] 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; }