index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-09-10 09:31:15 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2011-09-11 13:45:59 +1000 |
commit | 4737a87b84742e6d704e1a59792aed9427cbf620 (patch) | |
tree | 43136257dcaf02458e6494c29a6efd1df3cd5a2f /src | |
parent | f7653e582bc499b0c2d16968220c63615ddb9a56 (diff) |
-rw-r--r-- | src/pacman/callback.c | 10 |
diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 6991430b..fffaf2ed 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -679,8 +679,14 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total) xfered_human = humanize_size(xfered, '\0', &xfered_label); printf(" %ls%-*s ", wcfname, padwid, ""); - printf("%6.1f %3s %4.f%c/s ", - xfered_human, xfered_label, rate_human, rate_label[0]); + /* We will show 1.6M/s, 11.6M/s, but 116K/s and 1116K/s */ + if(rate_human < 100.0) { + printf("%6.1f %3s %4.1f%c/s ", + xfered_human, xfered_label, rate_human, rate_label[0]); + } else { + printf("%6.1f %3s %4.f%c/s ", + xfered_human, xfered_label, rate_human, rate_label[0]); + } if(eta_h == 0) { printf("%02u:%02u", eta_m, eta_s); } else if(eta_h < 100) { |