I believe I have found a bug in Nop 4.30's Order Total Calculation.

I have a 10% Discount assigned to order subtotal.

My shop uses VAT inclusive pricing, displayed with VAT included.

I placed an order that sub-totalled £113.29 inc tax. The discount was correctly calculated as £11.33. These both show correctly in the Order Detail in the admin. I then have Shipping of £5 inc tax. I would expect a total of:
£113.29 - £11.33 + £5 = £106.96

However, the Order Total is showing as £106.97.

I tried the "shoppingcartsettings.roundpricesduringcalculation" setting as false and this just caused the prices in the database to be stored to more than 2 Decimal Places.

Looking at the OrderTotalCalculationService it seems that Discount and Order Subtotal prices are always based on Ex VAT prices (even when the site uses inclusive prices for products), which introduces rounding errors when Inc VAT prices are converted to Ex VAT prices. They are then discounted by a percentage, added/subtracted and then converted back and rounded. This causes the Order Total to regularly be out by £0.01

I managed to fix it with the following in OrderTotalCalculationService.cs


Very grateful for any insight into this.