Skip to main content
Type cast functions convert one data type into another.

INT

The expression T(v) converts the value v to the type T. The INT(arg) Casts the argument to an integer, truncating the value if necessary. The argument is first coerced to a float if possible. Non-numeric values return 0.
# Usage: INT(arg1)
# Examples
INT($price_dollars)
INT(DIV($seconds, 3600))

FLOAT

Casts the argument to a float. Non-numeric values return 0.0.
# Usage: FLOAT(arg1)
# Examples
FLOAT($price_dollars) # For example, 300.5
FLOAT("3.1415926535") # 3.1415926535

BOOL

Casts the argument to a bool. Evaluates to true if the argument is truthy:
source typevalueBOOL($value)
int0false
int(anything else)true
float0.0false
float(anything else)true
string"true"true
string(anything else)false
booltruetrue
boolfalsefalse
nilfalse
# Usage: BOOL(arg1)
# Examples
BOOL($price_dollars) # For example, true
BOOL("")             # false
BOOL(true)           # true

STRING

Casts the argument to a string. Empty arguments are converted to "".
# Usage: STRING(arg1)
# Examples
STRING($price_dollars) # "300.5", for example
STRING(true)           # "true"
STRING($empty_column)  # ""