We have:
MINUTES_UNTIL_ASK_TO_CLOSE="0,2"
number_of_iterations=$((MINUTES_UNTIL_ASK_TO_CLOSE * 60 / 5))
There are a couple of weird behaviors when doing that.
Firstly, the result should be:
number_of_iterations = 0,2 * 60 / 5 = 2,4
However, the output of: echo "number_of_iterations" $((MINUTES_UNTIL_ASK_TO_CLOSE * 60 / 5))
is:
24
Secondly, I want to use it in the loop for ((a=1; a<=$number_of_iterations; a++)); do
, it should be an integer. So actually the final desired output is:
2
How to do this this rounding of variables of float to int in applescript correctly?
I’ve tried the following, but it crashes the script:
echo "number_of_iterations" $((round(MINUTES_UNTIL_ASK_TO_CLOSE * 60 / 5))