Numeric
The Numeric registry includes a range of utilities for performing numerical operations and calculations, making it easier to handle numbers and perform math functions in your templates.
floor
{{ 3.7 | floor }} // Output: 3
{{ floor 1.5 }} // Output: 1
{{ floor 123.9999 }} // Output: 123
{{ floor 123.0001 }} // Output: 123
{{ floor "invalid" }} // Errorceil
{{ 3.1 | ceil }} // Output: 4
{{ ceil 1.5 }} // Output: 2
{{ ceil 123.9999 }} // Output: 124
{{ ceil 123.0001 }} // Output: 124
{{ ceil "invalid" }} // Errorround
add / addf
add1 / add1f
sub / subf
mul
mulf
div
divf
mod
min
minf
max
maxf
Last updated