Function Friday - Data Type Conversion Functions - Bool, Decimal, Float, Int, String
For this batch of functions, we’ll start delving into the data type conversion functions. For the first group let’s look at the base type conversions. They all work pretty much the same way.
Bool The bool function is used to convert input data into boolean form (i.e. true or false). The format is pretty straightforward:
bool(<value>) The value can be of number or string data types. The output depends on the data type of the input. Numbers all work the same way, whether it’s an int, float, or decimal. If the input number is 0, bool returns false. If the input number is any other value, positive or negative, and the result is true.