question

saiavanigadda avatar image
saiavanigadda asked ben-m answered

Total Calculation with Taxes is always 1 cent off

I need some help regarding calculating the right total through my app which will start a payment sale request to charge the customers.


The merchants can add a misc fee to a custom sale done through my app. This misc fee is created as a variable line item in inventory and customer can add taxes to it.


Now when I try to create a sale from my app, the misc fee adds up and show for a total of 10.24$ iny my app.

Now when I perform sale request for that, on clover payment connector it shows 10.25$. I tried using Round.HALF_UP but still no luck. For some values, it shows right amount. For other values it shows a 1 cent off on clover display. Need help with in how I can proceed.

OrdersClover Android SDKClover Miniclover developer communitydeveloper pay
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ben-m avatar image
ben-m answered

Hi @saiavanigadda ,

The 1 cent difference between the app total and Clover total is because of how taxes are calculated and rounded. When taxes are calculated for each line item, rounding variations happen at the sub-cent level. However, when taxes are calculated for the total amount, rounding occurs after adding up individual taxes. These rounding variations can cause the 1 cent discrepancy.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

parquet76 avatar image
parquet76 answered

You haven't provided a lot of details, you may want to check out the accepted answer here - https://community.clover.com/questions/18115/tax-calculation-mismatch-issues.html

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community