To String (Boolean)
The To String (Boolean) node in Magick converts a boolean value (true or false) into its string representation.
Inputs
a(boolean): The boolean value to be converted to a string. Default value isfalse.
Outputs
result(string): The string representation of the input boolean value.
Configuration
This node does not have any configuration options.Usage
- Connect a node that outputs a boolean value (such as a comparison node or a boolean constant node) to the
ainput of the To String (Boolean) node. - The
resultoutput will contain the string representation of the input boolean value, either"true"or"false".
Example
Suppose you have a spell that checks if a number is greater than 10 and you want to display the result as a string. You can use the To String (Boolean) node to convert the boolean output of the comparison node to a string.- Connect a Number node to the
ainput of a Greater Than node. - Set the
binput of the Greater Than node to10. - Connect the
resultoutput of the Greater Than node to theainput of the To String (Boolean) node. - Connect the
resultoutput of the To String (Boolean) node to a Display Alert node to show the string representation of the comparison result.
Best Practices
- Use the To String (Boolean) node when you need to convert a boolean value to a string for display purposes or for concatenating with other strings.
- Keep in mind that the output will always be lowercase (“true” or “false”).
