Update cpu_usage

changed:
printf "%.${decimals}f%%\n", $cpu_usage;
to:
printf "%02.${decimals}f%%\n", $cpu_usage;
lines 50 + 52

for this:
always print two digits (leading zero) in front of the decimal point 
see here:
https://forum.endeavouros.com/t/min-width-cpu-100-00/21129/2?u=joekamprad
This commit is contained in:
Johannes Kamprad
2022-02-08 17:04:32 +01:00
committed by GitHub
parent a1862c891e
commit 31f2e3ef1d
+2 -2
View File
@@ -47,9 +47,9 @@ $cpu_usage eq -1 and die 'Can\'t find CPU information';
# Print short_text, full_text
print "${label}";
printf "%.${decimals}f%%\n", $cpu_usage;
printf "%02.${decimals}f%%\n", $cpu_usage;
print "${label}";
printf "%.${decimals}f%%\n", $cpu_usage;
printf "%02.${decimals}f%%\n", $cpu_usage;
# Print color, if needed
if ($cpu_usage >= $t_crit) {