gaboshlib/g_num_valid_number.sh hinzugefügt

This commit is contained in:
olli 2023-10-31 17:31:54 +01:00
parent efad917366
commit 233b737809

View File

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