Woocommerce return get_total() price with two decimals

Hi I am implementing one payment gateway plugin but have a problem. It shows an error and they said it is because total amount of cart and total amount of a price website is sending for them is different. And it is because they are getting it without decimal numbers for ex. in cart it is 519.00 and they are receiving just 519.

This plugin gets cart total by $order->get_total() function. Is there any method to make function get_total() take order price already with .00? or if it is 519.5 to make it 519.50 and so on ?

Changing a function in their plugin might work too but I tried other like WC()->cart->total but it shows the totals without decimals too.

Thanks!

Read more here: Woocommerce return get_total() price with two decimals

Leave a Reply

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