Clamp
Value = Clamp ( Expression , Minimum , Maximum )
Since 3.21
Clamp
Expression between
Minimum and
Maximum.
In other words:
-
If Expression is lower than Minimum, return Minimum.
-
If Expression is greater than Maximum, return Maximum.
-
Otherwise return Expression.
Arguments must be numbers or date/time values.
Examples
PRINT Clamp(2, 5, 10);; Clamp(6, 5, 10);; Clamp(11, 5, 10)
See also