Skip to content

Commit da653f8

Browse files
etanotBenBE
authored andcommitted
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: hishamhm#946
1 parent d35db47 commit da653f8

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Process.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,9 +739,6 @@ void Process_printPercentage(float val, char* buffer, int n, int* attr) {
739739
*attr = CRT_colors[PROCESS_SHADOW];
740740
}
741741
xSnprintf(buffer, n, "%4.1f ", val);
742-
} else if (val < 999) {
743-
*attr = CRT_colors[PROCESS_MEGABYTES];
744-
xSnprintf(buffer, n, "%3d. ", (int)val);
745742
} else {
746743
*attr = CRT_colors[PROCESS_MEGABYTES];
747744
xSnprintf(buffer, n, "%4d ", (int)val);

0 commit comments

Comments
 (0)