I’ve been working on a Flow internal email, and can’t get the cents on the product price to show up in correct money format, with 2 digits after the decimal. Many of the products are even-dollar amounts ($25.00 for example) but are coming through in the email with just a single digit ($25.0).
If I pipe the variable for the price through “|money” the run fails with the error: “The rendered liquid was too large or had too many assignments”
{{lineItems_item.name}} at ${{lineItems_item.variant.price |money }} x
{{lineItems_item.currentQuantity}}
I’ve sampled many variables, with “money” and “decimal” types from the variables list and every one I’ve tried performs the same way. Is there some way to format this to correctly show both digits to the right of the decimal in the price amount?
Hi @Dan-From-Ryviu , thanks for responding. I tried your code to confirm that it also doesn’t work. I don’t think it’s possible to pipe variables through the filters used for on-site liquid.
Flow does not use the same liquid filters as themes. It uses this library https://shopify.github.io/liquid/. So that | money_without_trailing_zeros does not work
Thanks @paul_n - yep, that isn’t pretty but it works!
I updated for the line items:
{% assign money = lineItems_item.variant.price | split: "." %}{% assign cents = money | last %}{% if cents == "0" %}{{ money | first }}.00{% else %}{{lineItems_item.variant.price}}{% endif %}
and used your suggestion for the order total (updated money to totmoney in case of conflict), and still found a case where the order total ended in .90 and shows .9 still, of course, but this is light years better for the even dollar amounts. Thank you!
Any chance a number padding filter or money filter might be added someday which would catch all these missing zeroes?