Skip to main content

NumberRange

The number should be within a specific interval.

Parameter table

paramunitrequireddescription
keyyesThe key of the number to check if it is within a specific interval (key)
minnoThe minimum value of the interval
maxnoThe maximum value of the interval
includeMinnoWhether the minimum value is included in the interval
includeMaxnoWhether the maximum value is included in the interval

How to setup

The rule verifies whether the number associated with the specified (key) is within a specific interval. If the number does not meet this criterion, the rule will fail.

The interval is further defined by the following parameters:

  • includeMin: whether the minimum value should be inclusive or exclusive.
  • includeMax: whether the maximum value should be inclusive or exclusive.

Note: min and max are inclusive by default.

Examples

valuevalidincludeMaxincludeMinmaxmindescription
5100The number should be within the interval [0, 10]
100100The number should be within the interval [0, 10[
00100The number should be within the interval ]0, 10]
000100The number should be within the interval ]0, 10[
01100The number should be within the interval [0, 10]
1011100The number should be within the interval [0, 10]
500100The number should be within the interval [0, 10]