The abs filter returns the absolute value.
{# number = -5 #} {{ number|abs }} {# outputs 5 #}
Note
Internally, Twig uses the PHP abs function.
Filters
batch
Enter search terms or a module, class or function name.