Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
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?
Thanks in advance for any help with this!
Solved! Go to the solution
This is an accepted solution.
I don't like it, but I know this works:
{% assign money = order.currentTotalPriceSet.shopMoney.amount | split: "." %}{% assign cents = money | last %}{% if cents == "0" %}{{ money | first }}.00{% else %}{{order.currentTotalPriceSet.shopMoney.amount}}{% endif %}
Hi @B2C-YYC
Could you try this code and check if it works?
{{lineItems_item.name}} at ${{lineItems_item.variant.price | money_without_trailing_zeros }} x {{lineItems_item.currentQuantity}}
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
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 - I reviewed all the available filters, and thought "round: 2" might work - tried this:
{{lineItems_item.name}} at ${{lineItems_item.variant.price | round: 2 }} x {{lineItems_item.currentQuantity}}
but I'm still getting a single cent digit when I retry the run. Do you have any other formatting suggestions to tackle this?
This is an accepted solution.
I don't like it, but I know this works:
{% assign money = order.currentTotalPriceSet.shopMoney.amount | split: "." %}{% assign cents = money | last %}{% if cents == "0" %}{{ money | first }}.00{% else %}{{order.currentTotalPriceSet.shopMoney.amount}}{% endif %}
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?
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025