BOOLEAN_2_SCALAR
Takes boolean type data and converts it into scalar data type. 1 means true and 0 means false Params: default : Boolean The input boolean to which we apply the conversion to. Returns: out : Scalar The scalar result from the conversion of the input.
Python Code
from flojoy import flojoy, Boolean, Scalar
@flojoy
def BOOLEAN_2_SCALAR(default: Boolean) -> Scalar:
"""Takes boolean type data and converts it into scalar data type.
1 means true and 0 means false
Parameters
----------
default : Boolean
The input boolean to which we apply the conversion to.
Returns
-------
Scalar
The scalar result from the conversion of the input.
"""
if default.b:
return Scalar(c=1)
return Scalar(c=0)
Example
Having problems with this example app? Join our Discord community and we will help you out!
In this example, BOOLEAN
node generates true. It converts its value to scalar type value and visualize it with BIG_NUMBER
node.