Built-ins for booleans

string (when used with a boolean value)

expr?string
expr?string(true-expr, false-expr)

Converts a boolean to a string. You can use it in two ways:

foo?string
Converts the boolean to string using the default strings for representing true and false values. By default, true is rendered as true and false is rendered as false. To change these default strings, you can use the boolean_format setting. Note that if the variable is a multi-type variable that is both boolean and string, the string value of the variable is returned.

foo?string("yes", "no")
Returns the first parameter (here: "yes") if the boolean is true; otherwise the second parameter (here: "no"). Note that the return value is always a string. If the parameters are numbers, they are first converted to strings.