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
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $int && $found =~ . ]]; then
|
if [[ -n $int && $found =~ [.|,] ]]; then
|
||||||
found=${found%.*}
|
found="${found/,/.}"
|
||||||
|
printf -v found "%.0f" "${found}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $math && -n $int ]]; then
|
if [[ -n $math && -n $int ]]; then
|
||||||
|
|
Loading…
Reference in New Issue