{%- macro format(amount, currency) -%} {% if not currency %}{% set currency = 'BRL' %}{% endif %} {% if amount %} {% if amount < 0 %} ({{ (amount/100)|number_format(2,',','.') }}) {% else %} {{ (amount/100)|number_format(2,',','.') }} {% endif %} {% else %} 0,00 {% endif %} {%- endmacro -%}