summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorKumar <kumar@onenetbeyond.org>2022-02-15 20:33:44 +0530
committerBenBE <BenBE@geshi.org>2022-02-19 12:21:26 +0100
commitda653f8148228c2202117cf2cea946b305039552 (patch)
treeab897c6e12bf28fd5d5fe6a71fcb66a5fc40e5e0 /Process.c
parentd35db47c9ad7bfe02c319b39c573c20fa823d387 (diff)
Process: Show only integer value when CPU% more than 99.9%
When we run a process which utilizes CPU between 100.0% and 999.9%, htop shows an unnecessary decimal character at the end of the value. For example, '100.x' and '247.x' become '100.' and '247.' respectively. When CPU utilization is less than and equal to '99.9%', show the result with single digit precision and if result is less than four characters, pad it with the blank space. When CPU utilization is greater than '99.9%', show only integral part of the result and if it's less than four characters, pad it with the blank space. Closes: #946
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/Process.c b/Process.c
index 89ccaf27..a3118b46 100644
--- a/Process.c
+++ b/Process.c
@@ -739,9 +739,6 @@ void Process_printPercentage(float val, char* buffer, int n, int* attr) {
*attr = CRT_colors[PROCESS_SHADOW];
}
xSnprintf(buffer, n, "%4.1f ", val);
- } else if (val < 999) {
- *attr = CRT_colors[PROCESS_MEGABYTES];
- xSnprintf(buffer, n, "%3d. ", (int)val);
} else {
*attr = CRT_colors[PROCESS_MEGABYTES];
xSnprintf(buffer, n, "%4d ", (int)val);

© 2014-2024 Faster IT GmbH | imprint | privacy policy