Money formatting in Flow email

Solved

Money formatting in Flow email

B2C-YYC
Shopify Partner
9 0 2

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).   

2025-03-25 20_24_25-Inbox - sue@bricks2clicks.online - Outlook.png

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?

2025-03-25 20_17_43-FN Simple Uniforms · Flow · Shopify.png

Thanks in advance for any help with this!

Bricks2Clicks: Helping bricks & mortar stores stay afloat online.
Accepted Solution (1)
paul_n
Shopify Staff
1717 188 394

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 %}
Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.

View solution in original post

Replies 7 (7)

Dan-From-Ryviu
Shopify Partner
11534 2257 2438

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.

B2C-YYC
Shopify Partner
9 0 2

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.

2025-03-26 10_06_21-FN Simple Uniforms · Flow · Shopify.png

Bricks2Clicks: Helping bricks & mortar stores stay afloat online.
paul_n
Shopify Staff
1717 188 394

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

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
B2C-YYC
Shopify Partner
9 0 2

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?

2025-03-26 13_11_23-Inbox - sue@bricks2clicks.online - Outlook.png

Bricks2Clicks: Helping bricks & mortar stores stay afloat online.
paul_n
Shopify Staff
1717 188 394

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 %}
Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
B2C-YYC
Shopify Partner
9 0 2

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?

 

2025-03-26 14_19_49-Inbox - sue@bricks2clicks.online - Outlook.png

 

Bricks2Clicks: Helping bricks & mortar stores stay afloat online.
paul_n
Shopify Staff
1717 188 394
Yeah it’s possible. I don’t have a timeline for this though.
Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.