Well, simply:
if (ONE < number && number < TWO)
or if you want to always put the variable on the left:
if (number > ONE && number < TWO)
Obviously you may want to use >=
or <=
to open/close the range, for example a lower-bound-inclusive, upper-bound-exclusive:
if (number >= ONE && number < TWO)
manpreet
Best Answer
2 years ago
I have set some constants.
I have a number
this.number
I want to check if the number is between ONE and TWO.
I got
I cant work out how to check if its between though. Cheers