To Boolean (Integer)
The To Boolean (Integer) node converts an integer value to a boolean value. It returnstrue if the input is non-zero, and false if the input is zero.
Inputs
a(integer, default: 0): The integer value to convert to a boolean.
Outputs
result(boolean): The boolean result of the conversion.
Configuration
This node has no configuration options.Usage
- Connect an integer value to the
ainput of the To Boolean (Integer) node. - The node will output
trueif the input value is non-zero, andfalseif the input value is zero. - Connect the
resultoutput to the desired destination node.
Example
Here’s an example of how to use the To Boolean (Integer) node in a spell:- The constant integer node (1) outputs the value 42.
- The To Boolean (Integer) node (2) converts the integer value to a boolean, which will be
truesince 42 is non-zero. - The branch node (3) uses the boolean result to conditionally route the flow to either the “true” log node (4) or the “false” log node (5).
Best Practices
- Use the To Boolean (Integer) node when you need to convert an integer value to a boolean for use in conditional logic or other boolean operations.
- Keep in mind that any non-zero integer will result in
true, while only zero will result infalse.
Common Issues
- Ensure that the input to the To Boolean (Integer) node is actually an integer. Connecting a non-integer value may lead to unexpected behavior or errors.
