Further fixes to bandwidth display (how hard can it be... ?)

This commit is contained in:
pdw
2002-10-18 13:59:00 +00:00
parent 4e6b940b9e
commit 41f4c93226

4
ui.c
View File

@@ -87,10 +87,10 @@ int screen_line_compare(void* a, void* b) {
void readable_size(float n, char* buf, int bsize, int ksize, int bytes) { void readable_size(float n, char* buf, int bsize, int ksize, int bytes) {
int i = 0; int i = 0;
int size = 1; float size = 1;
while(1) { while(1) {
if(n < size * ksize || i >= UNIT_DIVISIONS - 1) { if(n < size * 1000 || i >= UNIT_DIVISIONS - 1) {
snprintf(buf, bsize, " %4.0f%s", n / size, bytes ? unit_bytes[i] : unit_bits[i]); snprintf(buf, bsize, " %4.0f%s", n / size, bytes ? unit_bytes[i] : unit_bits[i]);
break; break;
} }