aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2013-03-23 13:11:54 +0000
committerAlexander Motin <mav@FreeBSD.org>2013-03-23 13:11:54 +0000
commit8d2419b5718ad893ddc290382d5985e91dce1963 (patch)
treece3dede0fbaeb3ad1ee04f4939d1d72bcf9f1c6e
parentca84e042a3b70b7daac4335184be702ad966fcd9 (diff)
Notes
-rw-r--r--usr.bin/systat/vmstat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index 856a9a6b04a4..cdb26a7a1b03 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -703,6 +703,10 @@ putfloat(double f, int l, int lc, int w, int d, int nz)
snr = snprintf(b, sizeof(b), "%*.*f", w, d, f);
if (snr != w)
snr = snprintf(b, sizeof(b), "%*.0f", w, f);
+ if (snr != w)
+ snr = snprintf(b, sizeof(b), "%*.0fk", w - 1, f / 1000);
+ if (snr != w)
+ snr = snprintf(b, sizeof(b), "%*.0fM", w - 1, f / 1000000);
if (snr != w) {
while (--w >= 0)
addch('*');
@@ -731,6 +735,10 @@ putlongdouble(long double f, int l, int lc, int w, int d, int nz)
snr = snprintf(b, sizeof(b), "%*.*Lf", w, d, f);
if (snr != w)
snr = snprintf(b, sizeof(b), "%*.0Lf", w, f);
+ if (snr != w)
+ snr = snprintf(b, sizeof(b), "%*.0Lfk", w - 1, f / 1000);
+ if (snr != w)
+ snr = snprintf(b, sizeof(b), "%*.0LfM", w - 1, f / 1000000);
if (snr != w) {
while (--w >= 0)
addch('*');