Remove Trailing Zeros on Woocommerce Prices

Aug 18, 2020 | WooCommerce, Wordpress

Want to get rid of those annoying zeros after the decimal place on your website? Fortunately it’s nice and easy!

Simply open up your theme functions.php file, and add the following to the end.

// REMOVE TRAILING ZEROS ON PRICES
add_filter( 'woocommerce_price_trim_zeros', 'joy_hide_trailing_zeros', 10, 1 );
function joy_hide_trailing_zeros( $trim ) {
    return true;
}

Did you find this helpful? Do you have any questions? We’d love to hear from you – drop us a comment below.

Browse More Hints & Tips

Tips for grabbing the perfect .com domain name

Tips for grabbing the perfect .com domain name

Looking for the perfect .com domain name? You’re in the right place! Below we’ll share our best tips to help you grab a name that’s memorable, easy, and SEO-friendly — something you’ll be proud of and that Google (and AIs like ChatGPT) will love too. 1. Keep it short...

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *