mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 12:44:34 +03:00
Process: Display single digit precision for CPU% greater than 99.9%
Since commit edf319e[1], we're dynamically adjusting column width of
"CPU%", showing single digit precision also for values greater than
"99.9%" makes "CPU%" column consistent with all other values.
[1]: edf319e53d
Change "Process_printPercentage()" function's logic to always display
value (i.e. "val") with single precision. Except when value is greater
than "99.9%" for columns like "MEM%", whose width is fixed to "4" and
value cannot go beyond "100%".
Credits: @Explorer09, thanks for the patch[2] to fix title alignment
issue.
[2]: https://github.com/htop-dev/htop/pull/959#issuecomment-1092480951
Closes: #957
This commit is contained in:
@ -144,7 +144,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
|
||||
},
|
||||
[PERCENT_CPU] = {
|
||||
.name = "PERCENT_CPU",
|
||||
.title = "CPU% ",
|
||||
.title = " CPU%",
|
||||
.description = "Percentage of the CPU time the process used in the last sampling",
|
||||
.flags = 0,
|
||||
.defaultSortDesc = true,
|
||||
|
Reference in New Issue
Block a user