Tax Rounding To The Third Decimal?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
I have v3.90 with the default tax calculation by country/state which is set to 8.25%.

Take this example of an item that is $50. Tax on this item at 8.25% would be $4.125. NopC records the tax at $4.12 and drops off the $0.005.

This is a problem because REAL accounting and ERP systems round the third decimal which would make the tax $4.13.

How can I get NopC to round the third decimal since it is causing an inaccuracy issue?

Regards
5 years ago
Hello,

you can round dynamically whole store currency from here.

http://admin-demo.nopcommerce.com/Admin/Currency/Edit/1.

However,

if you want specific tax rounding than you could customize your store.

hope you could understand.
5 years ago
I appreciate you took the time to respond. Thank you.

However, the rounding area you mentioned only goes to two decimal places. Also, no information on what "Default rounding" actually means while the others provide examples.

The solution is either create a three decimal rounding option in the setting you mentioned. Or as you said, create a customization which I am not qualified to perform.

I doubt I am the only person who has come across this situation. Maybe I should seek a nopC developer opinion and project estimate

Regards.
5 years ago
Hello,

see this picture nopcommerce default rounding is 2.

if you wish than go to this image file and set 3 instead of 2 than your whole site will reflect 3 rounding place.

https://gifyu.com/image/x6Gg

but if you want to set for tax than some of customization require.

Hope you could understand.
5 years ago
Unfortunately, the site is "No source". Also, I have never compiled source before.

It would be a good test to see if it worked but don't have a way to implement it. The change may need to go in the tax provider anyway if your test failed.

Still, I will give you an upvote for trying. Thank you.

Regards
5 years ago
Hello,

Yes,once tried.

And let me know working or not?

Thank you for your up vote..!!
5 years ago
I'm Having exact problem, (nopCommerce 3.9)
Item Value is $175  TAX is 11.5  Total should be $195.125 rounded MUST be $195.13
nopCommerce's Total is $195.12 (This is just wrong! at least in the US market)


I know nopCommerce has updated to newer versions but my HOSTING wont provide for .NET CORE yet.


I'm moving a company store over to nopCOmmerce and just found this problem.

I will try your source code edit.
Seems to me this should be a default setting, but in the rounding configuration page it only goes up to 2 decimal rounding (the default).

Any changes in this in the newer versions?

Thanks in advanced!
5 years ago
sk5202 wrote:
Hello,

see this picture nopcommerce default rounding is 2.

if you wish than go to this image file and set 3 instead of 2 than your whole site will reflect 3 rounding place.

https://gifyu.com/image/x6Gg

but if you want to set for tax than some of customization require.

Hope you could understand.


Changing this to 3 seems to have done the trick, I will see if anything broke anywhere else but for now, it all seems to be OK. (Famous last words )

Maybe this should be an option if it hasn't been added yet. This would have been a deal breaker if not solved, since all TAX and PRODUCT calculations are usually done to more than just 2 decimal points even though they are always rounded to 2 decimals for viewing.

Thanks again and I would still like to know if this has been addressed in future updates.
3 years ago
If anyone wants to make this change (the screenshots have gone!) and wants to know where the code lives. It's in...

Libraries\Nop.Services\Catalog\PriceCalculationService.cs

On line 520 (nop 4.3) in the method Round

modify this line...
var rez = Math.Round(value, 2);


to this...
var rez = Math.Round(value, 3);
2 years ago
Can anyone help me find this file in v4.40.4? I cannot even find the Libraries folder.

Is this a solution for the penny rounding error in this version also?

Many thanks.

Steve
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.