1006,10 → 1006,12 |
## Bool (0 or 1) |
is_bool() { [[ ($1 == '0') || ($1 == '1') ]] 2>/dev/null ; } |
## Float (XX.YY; XX.; ;.YY) (.24=0.24) |
is_float() { local P='^([0-9]+\.?([0-9])?+|(\.[0-9]+))$' ; [[ $1 =~ $P ]] ; } |
## XXX: 1.12.3: '^([0-9]+\.?([0-9])?+|(\.[0-9]+))$' |
is_float() { local P='^([0-9]+\.?[0-9]*|\.[0-9]+)$' ; [[ $1 =~ $P ]] ; } |
## Percentage (xx% or xx.yy%) |
## XXX: 1.12.3: '^([0-9]+\.?([0-9])?+|(\.[0-9]+))%$' |
is_percentage() { |
local P='^([0-9]+\.?([0-9])?+|(\.[0-9]+))%$' |
local P='^([0-9]+\.?[0-9]*|\.[0-9]+)%$' |
[[ $1 =~ $P ]] |
} |
## Interval |