Going from 47.97 to 48.00 will take more than the normal rounding rules. You can control how many decimals are used in WooCommerce – and it sounds like you only want to use 1 decimal: http://cld.wthms.co/1hIfL/1FzirLNz. Then you can use some custom code to append a ‘0’ to product prices in the frontend.
Thread Starter
bt_dev
(@biotrace)
Hi Caleb – Thanks for your reply. Unfortunately we need to supply wholesale pricing for some users and those prices would need 2 decimal places and the correct 0-9 digit in the second decimal place.
It would be great if someone could supply some code for a rounding rule that would work 🙂
Will take some customization either way.
There is this constant available: https://github.com/woothemes/woocommerce/blob/master/woocommerce.php#L185. But changing that to 1 would not be advisable as it would do more than just affect product prices.
Thread Starter
bt_dev
(@biotrace)
Thanks again for your reply Caleb. Just out of curiosity, what else on the site would changing that constant affect?
All of the rounding done for taxes, shipping costs, total order costs.
Could run into some mismatch issues with payment gateways, but I may be wrong.
Thread Starter
bt_dev
(@biotrace)
Ok, good to know. I’ll be sure to test thoroughly before going live. Thanks for your help Caleb!
I am having a similar issue. We export our order data out of Woo to XML for import into Dynamics AX. Since upgrading WooCommerce to 3.x. the <TaxTotal> of our XML export now shows four digits after decimal, where used to be only two.
The import of data into AX now chokes every time there’s an order with a tax calculation included.
How can we have <TaxTotal> go back to rounding to two decimals after the point?
The errors we get look like:
Error AIF AifRequestProcessor-processServiceRequest Invalid document schema. The following error was returned: The 'http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder:TotalSalesTax' element is invalid - The value '7.3393' is invalid according to its datatype 'http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder:AxdExtType_TaxAmountCur' - The FractionDigits constraint failed. 6/3/2017 11:15:19 pm Error AIF AifRequestProcessor-processServiceRequest Invalid document schema. The following error was returned: The 'http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder:TotalSalesTax' element is invalid - The value '7.3393' is invalid according to its datatype 'http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder:AxdExtType_TaxAmountCur' - The FractionDigits constraint failed. clust 6/3/2017 11:15:19 pm