There have been specific cases in which the currency configuration (eg. 1.500,25 or 1,500.25) is not dependant on the chosen language in Silverfin. As you know, the chosen language will affect how currencies are presented (with a separator ,
or .
the most common example).
Take a case in which we need to export certain numbers into XML or XBRL, which are classic examples that depict a different currency setting no matter which language you are working in.
So instead of adding a specific filter to every currency that needs to be exported, we created something new that will help you with a minimum of coding still export the currencies in the way you need them to be:
{% currencyconfiguration negative_format:"(xxx)" zero_format:"-" precision:3 delimiter:"," separator:"." %}
{% comment %} Add your currencies here {% endcomment %}
{% endcurrencyconfiguration %}
Whatever is put between the currencyconfiguration
tags, will be exported / printed the way you want them to see:
- zero_format:
0
or-
- negative_format:
(xxx)
or-xxx
- precision: eg
3
to make sure currencies are printed as xx,xxx - delimiter:
,
,.
,''
and' '
- separator:
,
or.
By using this extra configuration, you’ll overwrite whatever is set on firm and/or company level (if you don’t use this extra configuration, you fall back on these).
A clear example: a XML-file that needs to have all values of all accounts, can only be exported in as xxxxx,xx or -xxxxx,xx (if there is none value, it needs to be printed as 0).
So this can be used instead:
{% currencyconfiguration negative_format:"-xxx" zero_format:"0" precision:2 delimiter:"" separator:"," %}
<NumericField id="2261">{{ value_debit_1061 | currency }}</NumericField>
<NumericField id="2262">{{ value_debit_1062 | currency }}</NumericField>
<NumericField id="2263">{{ value_debit_1063 | currency }}</NumericField>
<NumericField id="2264">{{ value_debit_1064 | currency }}</NumericField>
<NumericField id="2265">{{ value_debit_1065 | currency }}</NumericField>
{% endcurrencyconfiguration %}
Credits to @Daria_Bobukh for this case