
Under General Settings in WooCommerce Settings screen, you will find options to set your store Currency, Currency position, Decimal separator and Number of decimals for your store. Here, Number of decimals lets you choose the number of digits to appear after the decimal separator.
Based on the selected option, it will display prices throughout your website with decimals (like $121.00). To remove decimals from every price, set Number of decimals to 0 in WooCommerce > Settings > General.
If you only want to hide a trailing .00, add the code below to the functions.php file of your theme. It shows $121.00 as $121, while a price with cents, such as $121.50, keeps its decimals.
add_filter( 'woocommerce_price_trim_zeros', '__return_true' );Want this checked on your own site? See Exivon Tech’s Website & E-commerce Audit.




8 responses to “Remove decimals from Product prices in WooCommerce”
If you want decimal but don’t want to show .00 values, then this function can be used to trim the zero values.
add_filter( ‘woocommerce_price_trim_zeros’, ‘__return_true’ );
Add this into the functions.php.
Thanks Deb.
This will be helpful.
Just what i was looking for, thank you!
Excelent!! Thanks
it worked for me thank you
thank you!
THANK YOU
Thanks. I added the code to a client site, but after a customer use a coupon code, the total price has 2 decimals. See image: https://trenza.se/wp-content/uploads/2022/03/code-tack15.jpg