1. Documentation
  2. Codex
  3. Snippets
  4. General Snippets

Hide trailing zeros on prices

The option to show trailing zeros on your prices has been removed in favor of a filter, as of WooCommerce 2.2x.

If you want to hide trailing zeros on your prices add the following code to your Theme’s functions.php file. After doing this your prices will not show the trailing zeros.


/**
* Trim zeros in price decimals
**/
add_filter( 'woocommerce_price_trim_zeros', '__return_true' );

WooCommerce - the most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment