Bug? difference of two numbers with filter currency

We wanted a warning if two digits were NOT the same.
Both digits were read in with currency filter, see code (e.g. 5.123,24 and 546,23)!
by adjusting the currency to ceil:2 it is solved.

verschilWarning|690x307 for some examples.

{% capture warning_bezoldiging %}
{% assign totaal_bezoldiging_bedrijfsleiders = period.reconciliations.REMUNERATION_DIRECTORS.results.totaal_bezoldiging_bedrijfsleiders | currency  %}
{% assign bezoldiging_bedrijfsleiders = $3 | currency  %}

{% if bezoldiging_bedrijfsleiders != totaal_bezoldiging_bedrijfsleiders %} 
{::warningtext } Het verschil bedraagt {{ totaal_bezoldiging_bedrijfsleiders-bezoldiging_bedrijfsleiders | currency | abs }} euro {:/warningtext}  
{% endif %}
{% endcapture %}

Kind regards

Rutger (Cobofisk)

Hey @RutgerC,

First, I’ve added your question to the templates section of our Community, as the COVID-19 section is only meant for, well, COVID-19 related things :slightly_smiling_face:

Do you still have a question towards this case? As I can see from your code, you are trying to compare 2 values with one another, so it makes sense to limit them with digits if one of those 2 values can have more than 2 digits

Hi @sven,

Oh sorry, thank you :slight_smile:
No further questions. The code works :slight_smile:

1 Like