Mon, 2016-10-03 11:53
Hi, I wish to assign a math value so I can then take the ceiling.
My current code is:
{% if variant.compare_at_price > variant.price %}
SAVE {{ variant.compare_at_price | minus:variant.price | times:100 | divided_by:variant.compare_at_price }}%
{% endif %}
Output is SAVE 20% (for example, but if it's 19.99 it'll be 19% rather than 20%)
But I want to call x= {{ variant.compare_at_price | minus:variant.price | times:100 | divided_by:variant.compare_at_price }}%
then take {{ x | ceil }}
How do I assign x?
Thanks in advance.