Only round to 0 digits for KiB/s values (bug #11152)

master
Mike Massonnet 2014-11-02 15:16:25 +01:00
parent 23ec87473e
commit c7b9a893a3
2 changed files with 3 additions and 3 deletions

View File

@ -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 );

View File

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