Boolean for whether a number is in a range

536 views Asked by At

Suppose I have a variable $$Range which is inputted as either a range (e.g. 1..2).

Can I write a boolean which is true if $$Number is in the range $$Range, and false otherwise?

E.g. $$Number is 1 and $$Range is 1..2 should return True, and $$Number is 4 and $$Range is 1..2 should return False.

1

There are 1 answers

1
Andy Hayden On BEST ANSWER

For convenience Set Variable [$$range2; Substitute($$Range;["..";" "];["...";" "]) ]

Then, the required boolean is:

RightWords($$range2;1) <= $$Number & $$Number < RightWords($$range2;2)