Remove Cents from Price

New Member
2 0 0

Prices in my industry are typically displayed in whole dollar amounts, without cents. For example, I would like $179 instead of $179.00 to be displayed on my site. Any code snippets or suggestions how to achieve this in Minimal please? Sample page is here: https://artware.com/collections/best-sellers/products/sonya-shannon-burning-down-the-house
Thanks much in advance!

PS would also like to remove the comma once the price is over $999. For example, $1299 instead of $1,299. Thank you!

0 Likes
Shopify Expert
2674 65 664

Hi Sonya, the first  part is easy -- go to your Admin Settings->General:Standards and formats, click Change Formatting and replace amount  with amount_no_decimals

CURRENCY FORMATTING

Change how currencies are displayed on your store. {{amount}} and {{amount_no_decimals}} will be replaced with the price of your product.

Want to hire me to tweak a theme? Mail me at tairli@yahoo.com!
My post solved your problem? Like it!
1 Like
New Member
2 0 0

Hi Tim -

Beautiful! Thanks much. Works perfectly.

Any suggestions for removing the comma for amounts over $999? I realize it may be more tricky...but I am open to HTML or CSS or whatever might work...

Thank you!

0 Likes
Shopify Expert
2674 65 664

Good question, actually.

It happens that there are more options for this field (was not quite sure about it myself :) -- look here https://help.shopify.com/manual/payments/currency-formatting

So you may use amount_no_decimals_with_space_separator instead. I believe the space (like $1 290) is acceptable for you, otherwise it needs to be done in Liquid and javascript, depending on your theme.

Want to hire me to tweak a theme? Mail me at tairli@yahoo.com!
My post solved your problem? Like it!
1 Like
Tourist
3 0 0

Thanks!

0 Likes