aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/twig/twig/doc/filters/abs.rst
blob: 3a82f62e4a4c0a6be87246f9c5d7f7b81a603e6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
``abs``
=======

The ``abs`` filter returns the absolute value.

.. code-block:: jinja

    {# number = -5 #}
    
    {{ number|abs }}
    
    {# outputs 5 #}

.. note::

    Internally, Twig uses the PHP `abs`_ function.

.. _`abs`: http://php.net/abs