Compare commits
No commits in common. "d36811c20c0487b1297710d613a8bf88960b5dac" and "70ed81ce910b31e96681d2d5fb6608058618cf4c" have entirely different histories.
d36811c20c
...
70ed81ce91
@ -22,7 +22,6 @@ function analyze {
|
|||||||
. dabo/functions/g_num_is_approx.sh
|
. dabo/functions/g_num_is_approx.sh
|
||||||
. dabo/functions/g_num_is_between.sh
|
. dabo/functions/g_num_is_between.sh
|
||||||
. dabo/functions/g_num_is_higher.sh
|
. dabo/functions/g_num_is_higher.sh
|
||||||
. dabo/functions/g_num_valid_number.sh
|
|
||||||
. dabo/dabo-bot.conf
|
. dabo/dabo-bot.conf
|
||||||
. dabo-bot.conf
|
. dabo-bot.conf
|
||||||
. analyze.conf
|
. analyze.conf
|
||||||
@ -121,7 +120,7 @@ analyzecounter=0
|
|||||||
|
|
||||||
for file in $@
|
for file in $@
|
||||||
do
|
do
|
||||||
echo "${file}" | egrep -q "BALANCE|-INDEX" && continue
|
echo "${file}" | egrep -q "BALANCE|MSCI-WORLD-INDEX" && continue
|
||||||
|
|
||||||
lines=$(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,' | wc -l)
|
lines=$(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,' | wc -l)
|
||||||
if [ $lines -lt 150 ]
|
if [ $lines -lt 150 ]
|
||||||
|
@ -7,8 +7,14 @@ function g_num_is_approx {
|
|||||||
local f_percentage_down=$4
|
local f_percentage_down=$4
|
||||||
|
|
||||||
# Check for valid decimal number
|
# Check for valid decimal number
|
||||||
|
for f_numtest in "${f_num}" "${f_base}" "${f_percentage_up}" "${f_percentage_down}"
|
||||||
g_num_valid_number "${f_num}" "${f_base}" "${f_percentage_up}" "${f_percentage_down}" || return 1
|
do
|
||||||
|
if ! [[ ${f_numtest} =~ ^(-)?[0-9]+(\.[0-9]+)?$ ]]
|
||||||
|
then
|
||||||
|
g_echo "\"${f_numtest}\"Not a valid number"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
local f_from=$(echo "${f_base} - (${f_base} / 100 * ${f_percentage_down})" | bc -l)
|
local f_from=$(echo "${f_base} - (${f_base} / 100 * ${f_percentage_down})" | bc -l)
|
||||||
local f_to=$(echo "${f_base} + (${f_base} / 100 * ${f_percentage_up})" | bc -l)
|
local f_to=$(echo "${f_base} + (${f_base} / 100 * ${f_percentage_up})" | bc -l)
|
||||||
|
@ -25,8 +25,15 @@ function g_num_is_between {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for valid number
|
# Check for valid decimal number
|
||||||
g_num_valid_number "$f_num" "$f_between1" "$f_between2" || return 1
|
for f_numtest in "$f_num" "$f_between1" "$f_between2"
|
||||||
|
do
|
||||||
|
if ! [[ ${f_numtest} =~ ^(-)?[0-9]+(\.[0-9]+)?$ ]]
|
||||||
|
then
|
||||||
|
g_echo "\"${f_numtest}\"Not a valid number"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Check which is the low (from) and the high (to) number
|
# Check which is the low (from) and the high (to) number
|
||||||
if [ $(echo "${f_between1} < ${f_between2}" | bc -l) -ne 0 ]
|
if [ $(echo "${f_between1} < ${f_between2}" | bc -l) -ne 0 ]
|
||||||
|
@ -15,8 +15,15 @@ function g_num_is_higher {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for valid number
|
# Check for valid decimal number
|
||||||
g_num_valid_number "$f_num" "$f_checkhigher" || return 1
|
for f_numtest in "$f_num" "$f_checkhigher"
|
||||||
|
do
|
||||||
|
if ! [[ ${f_numtest} =~ ^(-)?[0-9]+(\.[0-9]+)?$ ]]
|
||||||
|
then
|
||||||
|
g_echo "\"${f_numtest}\"Not a valid number"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Check which is the low (from) and the high (to) number
|
# Check which is the low (from) and the high (to) number
|
||||||
# Check if given number is in or out range
|
# Check if given number is in or out range
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user