How would I find where a number lands? For example, I have two number ranges, 0-0.20 and 0.21-0.40. How would I find out if a random number lands in between one of those? If a 0.348 got picked, how would I code it to find the right category?
✓ ANSWER ACCEPTED
How Would I Find Where a Number Lands?
1 answer
✓ Accepted answer
You'd use an if statement for that. You simpfuly check if the value is Bigger then NumberA, and smaller then NumberB.
if ChosenValue >= 0 and ChosenValue <= 0.2 then
--stuff
end
if ChosenValue > 0.2 and ChosenValue <= 0.4 then
--stuff
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I was thinking of that, but it seems inefficient because I am going to need to make dozens of if statements for this. I'll use it anyway.
If the value is always a 0.2 difference you can loop through it with a for loop