Ad

Shopify - No Decimal Places On Price Calculations

- 1 answer

I'm trying to display my prices in laybuy amounts. So a product costing $139 would be 6 payments of $23.17.

My 'price' value is 13900, so I display the following:

{{ price | divided_by: 6 | divided_by: 100 }}

This displays as 23 instead of 23.17

I've tried adding 2 points for decimal rounding, but this still just displays as 23.

{{ price | divided_by: 6 | divided_by: 100 | round: 2 }}
Ad

Answer

{{ price | divided_by: 6 | money }}
Ad
source: stackoverflow.com
Ad