gaboshlib/g_num_valid_number.sh hinzugefügt
This commit is contained in:
1 parent
efad917366
commit
233b737809
1 file changed
+11
@@ -0,0 +1,11 @@
|
|||||||
|
function g_num_valid_number {
|
||||||
|
local f_num
|
||||||
|
for f_num in $@
|
||||||
|
do
|
||||||
|
if ! [[ ${f_num} =~ ^(-)?(\.)?[0-9]+(\.[0-9]+)?$ ]]
|
||||||
|
then
|
||||||
|
g_echo "\"${f_num}\": Not a valid number"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
Reference in new issue
Block a user