Skip to content

Instantly share code, notes, and snippets.

@pdr
Created March 16, 2017 18:15
Show Gist options
  • Save pdr/776ea9c497406e778ac5abcfa2694338 to your computer and use it in GitHub Desktop.
Save pdr/776ea9c497406e778ac5abcfa2694338 to your computer and use it in GitHub Desktop.
{% with price = item.prices[0].price %}
{% set rounded = price|float|round(0, 'ceil') %}
{% if rounded > price|float %}
{{ item.prices[0].label }} {{ price|money('en_US', format='#,##0.00') }}
{% else %}
{{ item.prices[0].label }} {{ price|money('en_US', format='#,##0') }}
{% endif %}
{% endwith %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment