Conversion
The Conversion registry includes a collection of functions designed to convert one data type to another directly within your templates. This allows for seamless type transformations.
toBool
{{ "true" | toBool }} // Output: true
{{ "t" | toBool }} // Output: true
{{ 1 | toBool }} // Output: true
{{ 0.0 | toBool }} // Output: false
{{ "invalid" | toBool }} // ErrortoInt
{{ "1" | toInt }} // Output: 1
{{ 1.1 | toInt }} // Output: 1
{{ true | toInt }} // Output: 1
{{ "invalid" | toInt }} // ErrortoInt64
toUint
toUint64
toFloat64
toOctal
toString
toDate
toLocalDate
toDuration
Deprecated functions
atoi ⚠️
int ⚠️
int64 ⚠️
float64 ⚠️
Last updated