Forum Discussion
complex Liquid with percentages
{% assign original_number = 5 | plus: 0.0 %} {% assign new_number = {{custom_attribute.${weekly_total_breakfast_tracked}}} | plus: 0.0 %} {% if new_number >= original_number %} -- INCREASED VALUE --
{% assign difference_absolute = new_number | minus: original_number %} Absolute difference: {{difference_absolute | round}}
{% assign difference_percentage = difference_absolute | divided_by: original_number | times: 100 %} Difference in percentage: +{{difference_percentage | round}}% {% elsif new_number < original_number %} -- DECREASED VALUE --
{% assign difference_absolute = original_number | minus: new_number %} Absolute difference: {{difference_absolute | round}}
{% assign difference_percentage = difference_absolute | divided_by: original_number | times: 100 %} Difference in percentage: -{{difference_percentage | round}}% {% else %} {% endif %}
Related Content
- 6 months ago
- 2 months ago