mirror of https://github.com/aristocratos/bashtop
get_value function: fixed regex and added proper float to int rounding
parent
f1182ccace
commit
051e3608d7
5
bashtop
5
bashtop
|
@ -750,8 +750,9 @@ get_value() { #? Get a value from a file, variable or array by searching for a n
|
|||
done
|
||||
fi
|
||||
|
||||
if [[ -n $int && $found =~ . ]]; then
|
||||
found=${found%.*}
|
||||
if [[ -n $int && $found =~ [.|,] ]]; then
|
||||
found="${found/,/.}"
|
||||
printf -v found "%.0f" "${found}"
|
||||
fi
|
||||
|
||||
if [[ -n $math && -n $int ]]; then
|
||||
|
|
Loading…
Reference in New Issue