Hi Fabio,
I tested your code and did some changes to make it work. If the code should not be displayed correctly in this email, please see the attached text file.
<div>
<p>OffersAutoPriceAmount: {{ OffersAutoPriceAmount }}</p>
{% set OffersAutoPriceAmountMath = OffersAutoPriceAmount|replace({',': '.'}) %}
<p>OffersAutoPriceAmountMath: {{ OffersAutoPriceAmountMath }}</p>
<p>repo_custom_field_MSPrezzo: {{ repo_custom_field_MSPrezzo }}</p>
{% set repo_custom_field_MSPrezzoMath = repo_custom_field_MSPrezzo|replace({',': '.'}) %}
<p>repo_custom_field_MSPrezzoMath: {{ repo_custom_field_MSPrezzoMath }}</p>
<hr>
{% if (100-(OffersAutoPriceAmountMath / repo_custom_field_MSPrezzoMath)*100)|round < 0 %} (1)
{% else %}(2)<span class='green'>{{ (100-(OffersAutoPriceAmountMath/repo_custom_field_MSPrezzoMath)*100)|round }}%</span>
{% endif %}
{% if OffersAutoPriceAmountMath - repo_custom_field_MSPrezzoMath > 0 %} (1)
{% else %} (2)<span class='green'>€ {{ repo_custom_field_MSPrezzoMath - OffersAutoPriceAmountMath }}</span>
{% endif %}
</div>
I hope I was able to help you. If you still have questions, please let me know.
Kind regards,
Timo
Comments
0 comments
Please sign in to leave a comment.