If your values are guaranteed to be in the same form and range, you can do string comparisons:
if [[ $x > 0.70 ]]
then
echo "It's true"
fi
This will fail if x
is ".8" (no leading zero), for example.
However, while Bash doesn't understand decimals, its builtin printf
can format them. So you could use that to normalize your values.
$ x=.8
$ x=$(printf %.2 $x)
$ echo $x
0.80