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; }