Just put the numbers in parentheses and ===:
if ((9.74)...(9.78)) === amounts
count += 1
end
EDIT: If putting numbers in parentheses is not necessary, I would recommend it in any case, so that it makes it clear what a range is and what a decimal point is.
source
share