get_value function: fixed regex and added proper float to int rounding

pull/37/head
aristocratos 2020-04-26 10:11:22 +02:00
parent f1182ccace
commit 051e3608d7
1 changed files with 3 additions and 2 deletions

View File

@ -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