Wrong rounded amount in quote lines

Hi Everyone

I am stuck with a such a stupid little problem I am suprised I haven’t found a post on this matter…

The idea is simple : I have products sold at 13.00 €, VAT included. When I create quotes for any quantity of this product, I just want my total, VAT included, to be multiple of 13. For instance, 6 quantities of this product should have a total amount of 78.00 €.


I populate the product price with the amount without VAT 10.833 € to be exact.
By default, SuiteCRM displays 2 digits for decimals, inside the product panel it displays 10.83.

I then create a quote and add two lines:
1 quantity : 10.83 + 2.17 VAT = 13.00 - OK
12 quantities : 129.96 + 25.99 VAT = 155.95 - NOK -> it should be 156 !

I tried to change my profile settings to 3 digits curency:
total is now 129,996 instead of 130 because it is not rounded.
If I switch back to 2 digits, rounding is correct, but we can begin this thread again

Honestly I don’t know where to look, anyone to point me in the good direction ?

SuiteCRM v7.11.18

You forgot to say your SuiteCRM version.

I remember seeing a couple of issues on Github that could be what you’re describing. Possibly already fixed.

Sorry and thx pgr, it’s 7.11.18 I’ll update the main post

Indeed in Github I found this very old issue : https://github.com/salesagility/SuiteCRM/issues/1776
But it doesn’t seems fixed, it links to a trello post that links back to a 404…

There is this newer one

which will point you back into the Forums here, with a suggested workaround.

If that really works, somebody needs to create a PR on GitHub otherwise it will never be picked up by the developers…

Wahou many thanks pgr ! I’ll test it right away and keep you posted in this thread.
2017 indeed…

Fix doesn’t work in my case :

  • in 3 decimals mode, I’m off 0,002 € total (if this amount was rounded to 2 decimal it would have been OK)
  • in 2 decimals mode, i’m off 0,02 €

Can you get a developer to work on this?

The fix already points you to the correct spot in the code, it shouldn’t be too hard.

Yep, I contacted someone to fix this, I will keep this post updated with the solution.
If possible I will create a PR as well.

1 Like


Please have a look on the below to understand why the solution didn’t worked for you.

Scenario 1:

Qty: 1
Price: 10.83
VAT: 20%
Vat Amount Formula = (PriceVat)/100 i.e. (10.8320)/100 = 2.166, third digit is 6 so rounded to 2.17

Scenario 1:
Qty: 12
Price: 129.96
VAT: 20%
Vat Amount Formula = (PriceVat)/100 i.e. (129.9620)/100 = 25.992, third digit is 2 so rounding remains same to 25.99

I may be wrong but to me calculations are okay.

Hello @nabeeluos and thanks for your answer.
Actually you can think the other way around:
unit price + VAT = 13€
=> I want my invoice to reflect this total price, ie 6 quantities => total price = 6 x 13 = 78 €

My problem is to adjust the unit price to reflect this, because of the rounding mechanism in SuiteCRM.

Does it make more sense this way?

Can you share Screenshot from you Line Items and Annotate on where it is wrong for You?

Here you go !

First the product (when I display 3 digits the price is actually 10,833)

Then the line items in a new quote. Total is 90,98 instead of 91
(7 x 10,833 = 90,9972 => rounded at 2 digits it should be 91)