4 .. versionadded:: 1.15.0
5 The ``round`` filter was added in Twig 1.15.0.
7 The ``round`` filter rounds a number to a given precision:
14 {{ 42.55|round(1, 'floor') }}
17 The ``round`` filter takes two optional arguments; the first one specifies the
18 precision (default is ``0``) and the second the rounding method (default is
21 * ``common`` rounds either up or down (rounds the value up to precision decimal
22 places away from zero, when it is half way there -- making 1.5 into 2 and
25 * ``ceil`` always rounds up;
27 * ``floor`` always rounds down.
31 The ``//`` operator is equivalent to ``|round(0, 'floor')``.
36 * ``precision``: The rounding precision
37 * ``method``: The rounding method