# Numeric predicate
Evaluates a numeric input against a configured comparison operator and reference value(s), outputting a boolean result.
Numeric predicate
V
O
# Inputs
| ID | Abbrev | Name | Type | Default | Description |
|---|---|---|---|---|---|
value | V | Value | NUMBER | 0 | The numeric input value to be evaluated against the configured operator and reference value(s). |
# Outputs
| ID | Abbrev | Name | Type | Default | Description |
|---|---|---|---|---|---|
output | O | Output | BOOLEAN | false | A boolean output that is true when the input value satisfies the configured comparison, and false otherwise. |
# Configuration
| ID | Name | Type | Default | Unit | Description |
|---|---|---|---|---|---|
operator | Operator | ENUM | 0 | The comparison operator used to evaluate the input value against the configured reference value(s). Details: Values: Greater than, Greater or equal, Equal, Not equal, Less than, Less or equal, Between | |
operand | Operand | NUMBER | 0.0 | The reference value used for comparison with the input. For the 'Between' operator, this serves as the lower bound of the range. Details: Visible when operator = Greater than, Greater or equal, Equal, Not equal, Less than, Less or equal, Between | |
operand_2 | Operand 2 | NUMBER | 0.0 | The upper bound of the range for the 'Between' operator. The comparison is inclusive: output is true when the input value is greater than or equal to operand AND less than or equal to operand_2. Details: Visible when operator = Between> operand |
# Source Code
View Volang source
value = input::get("value")
operator = config::get("operator") // 0=GT, 1=GTE, 2=EQ, 3=NEQ, 4=LT, 5=LTE, 6=Between
operand = config::get("operand")
result = false
if (operator == 0) { // Greater than
result = value > operand
} else if (operator == 1) { // Greater or equal
result = value >= operand
} else if (operator == 2) { // Equal
result = value == operand
} else if (operator == 3) { // Not equal
result = value != operand
} else if (operator == 4) { // Less than
result = value < operand
} else if (operator == 5) { // Less or equal
result = value <= operand
} else if (operator == 6) { // Between (inclusive)
operand_2 = config::get("operand_2")
result = (value >= operand) and (value <= operand_2)
}
output::set("output", result)
