Rounding issue 3.90

2 years ago
Hi all,

There is something wrong with "Rounding up with 0.05 intervals (0.06 round to 0.10)".
Test environment: clean installation 3.90
SQL: 2014

Test product: Fahrenheit 451 by Ray Bradbury
Price with default rounding: 27.00
Price with Rounding up with 0.05... : 27.05

What is more. Add to cart with default rounding looks as below:


While just changing rounding option cause cart would show:


Suddenly sub-total showing as 27.15, shipping rise to 0.05, tax to 0.10, and two discounts are showing just by changing rounding.

Regards,
Tomasz
2 years ago
Hi Tomasz,

Thanks a lot for reporting. We'll investigate it soon (work item)
2 years ago
Done. Please see this commit for more details
2 years ago
Sergei-k wrote:
Done. Please see this commit for more details


Hello Sergei,

I was testing beta version and I found this:

As Tomek described, default rounding with price 27.05 works fine, but when I changed rounding to "Price with Rounding up with 0.05...", please look what I saw:

Note that product price is 27.05$. Product page:


And below is the view of shopping cart with applied "Price with Rounding up with 0.05...":


Best,
Patryk
2 years ago
Thank you Patryk, I opened the ticket again, I'll check it.
2 years ago
Hi. I checked this problem and fixed it. Please see this commit for more details
2 years ago
Sergei-k wrote:
Hi. I checked this problem and fixed it. Please see this commit for more details


Hello Sergei,

It's old commit, I guess you talked about this commit.

But I have doubts about this solution. What if we set price 27,10$ and choose "Price with Rounding up with 0.05..."?

Price before rounding: 27.10$
Price after "Rounding up with 0.05...": 27.15$.

Is it good solution? Of course 27,11$ should be rounded to 27.15$, 27.16$ to 27.20$, etc, if we choose this type of rounding. But I don't think, it should round 27.10$ to 27.15$.

Best,
Patryk
2 years ago
nop4you wrote:
Hi. I checked this problem and fixed it. Please see this commit for more details

Hello Sergei,

It's old commit, I guess you talked about this commit.

But I have doubts about this solution. What if we set price 27,10$ and choose "Price with Rounding up with 0.05..."?

Price before rounding: 27.10$
Price after "Rounding up with 0.05...": 27.15$.

Is it good solution? Of course 27,11$ should be rounded to 27.15$, 27.16$ to 27.20$, etc, if we choose this type of rounding. But I don't think, it should round 27.10$ to 27.15$.

Best,
Patryk


Hello Patryk. You are absolutely right, the problem was in the calculation algorithm itself, I rewrote this piece of code, please see the details here. Thank you very much for your help.
2 years ago
Sergei-k wrote:

Hello Patryk. You are absolutely right, the problem was in the calculation algorithm itself, I rewrote this piece of code, please see the details here. Thank you very much for your help.


It seems to be ok now.

Best,
Patryk
5 months ago
nopcommerce  3.90


Photo 1
https://subefotos.com/ver/?c6f49692495e8e212b4888e1bff4181eo.jpg


Photo 2
https://subefotos.com/ver/?ed9592e1f578a3d98ac49097183da6e0o.png



In the picture 1 we can see the options of rounding of decimals that brings nopcommerce. Which I have set in redodeo by default.

In photo 2 I show on the checkout page the calculation that nopcommerce performs:

1- Two products that count 15 each in total add up to 30.
2- 16% of 30 is 4.8.
3- 30 + 4.8 should give me exactly 34.8

The point is that in my nopcommerce I can not show or charge invoices with rounded amounts, I must charge what exactly of the sum of the totals and sub totals without any type of rounding.

what should I do?
can you help me?