abs#

The abs filter returns the absolute value.

{# number = -5 #}

{{ number|abs }}

{# outputs 5 #}

Примечание

Internally, Twig uses the PHP abs function.