you can use a bit more advanced regex to handle -10.4e5 e.g. That would require (in this implementation) a look ahead not offered by bash/ksh builtins. But grep with PCRE does.
#!/bin/bash
#set -x
a='-10.43'
a='10.4e5'
a='-10.4e5'
a='5.82376'
re='^[-+]?[0-9]*[.,]?[0-9]+(?:[eE][-+]?[0-9]+)?$'
#if [[ ${a} =~ ${re} ]]; then
if [ $(grep -P "${re}" <<<"${a}") ]; then
echo "[${a}] float"
else
echo "[${a}] NOT float"
fi
See if it's a bit better for YOUR test cases.
You can comment out my test cases and test yours.
look here - FYI.
Here's the version based on math and bc:
#!/bin/bash
#set -x
num=-213.213332222
#num=213.213332222
if [ $(bc -l <<< "if ( sqrt ( $num ^ 2 ) - $num == 0) 1 else 0") -eq 1 ]; then
echo "${num} pos"
else
echo "${num} neg"
fi