First, you need &&
operator instead of ||
, Second, No need to use M
.
Looks like you are newbie, forgive me if you are not.
min >= 0.01 && || <= 0.80
will be true if either min is bigger or equal to 0.01 or lesser or equal to 0.80, in this case min = 9999 will also be true because it is bigger than 0.01. Hence use &&
which will be true iff both conditions are matched.
decimal min = Math.Min(Length, Width);
if(min >= 0.01 && min <= 0.80)
{
}
1
solved check if value is in range of two numbers [closed]