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.
FLOAT
Casts the argument to a float.
Non-numeric values return 0.0.
BOOL
Casts the argument to a bool.
Evaluates to true if the argument is truthy:
| source type | value | BOOL($value) |
|---|---|---|
| int | 0 | false |
| int | (anything else) | true |
| float | 0.0 | false |
| float | (anything else) | true |
| string | "true" | true |
| string | (anything else) | false |
| bool | true | true |
| bool | false | false |
nil | false |
STRING
Casts the argument to a string.
Empty arguments are converted to "".