aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/ps.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-09-09 03:11:37 -0500
committerRob Landley <rob@landley.net>2020-09-09 03:11:37 -0500
commit54965cadfe8f1aef663600cb07d3edbb0acf8769 (patch)
tree3854cd6fd7f13efcaca953bee4c5dc40ecbbc4b8 /toys/posix/ps.c
parent6dedeb79511b4bbdcd2e1fbac10e2aa5d74930c5 (diff)
downloadtoybox-54965cadfe8f1aef663600cb07d3edbb0acf8769.tar.gz
Attempt internationalization of HR_COMMAS, 9 digit memory sizes for top,
and use the comma format when selected even if <3 digits (no 0.0M)
Diffstat (limited to 'toys/posix/ps.c')
-rw-r--r--toys/posix/ps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index cadc060b..6a7afda6 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1604,11 +1604,11 @@ static void top_common(
"\nBuffers:","\nSwapTotal:","\nSwapFree:","\nCached:"}[i]);
run[i] = pos ? atol(pos) : 0;
k = (*run>=10000000);
- human_readable_long(hr[j+!!j], run[i]>>(10*k), 8, k+1, HR_COMMAS);
+ human_readable_long(hr[j+!!j], run[i]>>(10*k), 9, k+1, HR_COMMAS);
if (j==1) human_readable_long(hr[1], (run[i-1]-run[i])>>(10*k),
8, k+1, HR_COMMAS);
else if (j==2) {
- sprintf(toybuf, " %s: %9s total, %9s used, %9s free, %9s %s",
+ sprintf(toybuf, " %s:%10s total,%10s used,%10s free,%10s %s",
(i<3) ? " Mem" : "Swap", hr[0], hr[1], hr[2], hr[3],
(i<3) ? "buffers" : "cached");
lines = header_line(lines, 0);