Function CLAMP
Returns the value if it is between minimum and maximum or return minimum/maximum if the value is lesser/greater than minimum/maximum
Usage
CLAMP(minimum, value, maximum)
Parameters
| minimum |
(Required) The minimum number to return |
| value |
(Required) The number to limit |
| maximum |
(Required) The maximum number to return |
Examples
More information
CLAMP is equivalent to MAX(minimum, MIN(maximum, value)), but is more intuitive.
Reminders
A text containing digits is not handled as a number. To have an actual number:
- use the
@NUMBER_QUESTIONto set the variable - write a numeric value directly in the code without quotes, ex:
age >= 18 - use a function which converts to a number:
NUMBER(text_containing_numbers) - use a function which returns a number:
FIND("world", "hello everybody")