Smaller then, larger then in a code block

Morning all,

I want to evaluate if a number is in between 2 in a code block. I can 2 it with a few nodes but i’d like the code block way
I used (x?y:z) for a single IF but is there a syntax for in between?

Thanks guys

This should work.

1 Like

Morning Paul,
y didnt ask my question right, sorry about that.

I have a value, if it’s smaller then 75 use 75, if it’s greater then 400 use 400. If not use the value.
I am now using 2 formulas to evaluate it

It’s fine, formulating these things can be difficult.
So you do you want it like this:

Here’s what im using right now

//Total Number of Rooms that failed the test
l1 = Count(l0);
//Temporary ListViewHeight
hTemp = l1 * 21;
hmin = hTemp < 75;
hminTemp = (hmin?75:hTemp);
hmax = hminTemp > 400;
h = (hmax?400:hminTemp);

I have no idea what’s going on there, all I can tell you is what my code does.
I don’t know how to change things with Dynamo when it comes to view height, I’d say that’s a different question for a different topic.

Regardless of what is the end use of the values, @PauLtus 's method gives the output you said you are looking for :slight_smile:
Broken down for better understanding:



Git it
Thanks guys :slight_smile: