mirror of
https://github.com/tmux-plugins/tmux-cpu.git
synced 2026-09-10 07:16:16 -04:00
Fix comma replacement
This commit is contained in:
parent
b8ac9cac6b
commit
f15e7853f4
|
|
@ -28,9 +28,6 @@ print_load() {
|
|||
sub(/,$/, "", $(NF-2));
|
||||
sub(/,$/, "", $(NF-1));
|
||||
sub(/,$/, "", $NF);
|
||||
sub(/,/, ".", $(NF-2));
|
||||
sub(/,/, ".", $(NF-1));
|
||||
sub(/,/, ".", $(NF));
|
||||
printf "%.2f %.2f %.2f", $(NF-2)/num_cores, $(NF-1)/num_cores, $NF/num_cores
|
||||
}')
|
||||
|
||||
|
|
@ -44,9 +41,14 @@ print_load() {
|
|||
15)
|
||||
output="$(awk '{ print $3 }' <<< "$output")"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid input." >&2
|
||||
return 2
|
||||
;;
|
||||
esac
|
||||
|
||||
echo -n "$output"
|
||||
# Replace commas with dots
|
||||
echo -n "${output//,/.}"
|
||||
}
|
||||
|
||||
main() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue