Home > Back-end >  WooCommerce Mini-cart.php round prices to 2 decimal places
WooCommerce Mini-cart.php round prices to 2 decimal places

Time:08-06

I have an issue with WooCommerce mini-cart.php and showing how many decimal places I want to show. On the rest of the site I want to show 3 decimal places but in mini-cart I would like to show 2 decimal places. Is there a way I can modifiy mini-cart.php template so the prices get rounded down to 2 decimal places?

Cheers

CodePudding user response:

$num = "25";
echo number_format((float)$num, 2, '.', '');  // Outputs -> 25.00

Thanks You Can Try This.

  • Related