a Sensio Labs Product

The flexible, fast, and secure
template engine for PHP

Filters » abs

Questions & Feedback

License

Twig documentation is licensed under the new BSD license.

absΒΆ

The abs filter returns the absolute value.

1
2
3
4
5
{# number = -5 #}

{{ number|abs }}

{# outputs 5 #}

Note

Internally, Twig uses the PHP abs function.

This website is powered by PHP and Twig. The Twig logo is © 2010-2012 Sensio Labs