-
Notifications
You must be signed in to change notification settings - Fork 121
Increase decimal points in order POST-PUT requests to mitigate tax rounding issues #15957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
|
@iamgabrielma excuse me for not reaching it today, I will review it tomorrow. |
staskus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, great work and investigation. Taxes are always a challenging area.
I didn't know we can send more decimal points to the API. I was always frustrated with some of the imprecision that would happen with a combination of tax rates and product prices. This does look to improve it 👍

This is the iOS counterpart of woocommerce/woocommerce-android#14134
Description
This PR fixes order creation rounding issues by adding the
dp=8(decimal places) parameter in create and update order API requests, which by default is set to2if nothing is passed in.This increases decimal precision to reduce discrepancies between client-side calculations and backend totals, addressing cases where item totals were incorrectly rounded (e.g., $6 product with 9% tax showing $11.00 instead of $11.01 for quantity of 2).
Changes
Steps to reproduce/Testing information
In general I found the tax setup and results quite confusing when sending from one country to another, the easier setup seemed to be to set your store to country X, and sells to a customer of the same country. Here's some conversation with some troubles we found during the debugging process in case you find something off with the tax calculation: p1753783743005429-slack-CGPNUU63E
Enter product prices including tax settingsis enabled)Screenshots
RELEASE-NOTES.txtif necessary.