The normal U.S. rounding rules specify that taxes are calculated by assessing the tax rate to the total cost of all of the items and then using the HALF_EVEN rounding mode, or banker's rounding, to determine the tax for the order. These rules are substantially different from the default rounding rules for U.K. merchants. For U.K. merchants, the default behavior is to calculate tax separately for each item in the order and then apply the HALF_UP rounding mode to each calculation.
I think we need to carefully investigate these issues and make sure the rounding rules are correctly implemented in OpenCart. I stumbled upon it while working on the Merchant Calculations API for the new Google Checkout module.
Take a look at the country-specific rounding rules. Qphoria, does PayPal have similar distinctions between different rounding-rules?
I think we need to carefully investigate these issues and make sure the rounding rules are correctly implemented in OpenCart. I stumbled upon it while working on the Merchant Calculations API for the new Google Checkout module.
Take a look at the country-specific rounding rules. Qphoria, does PayPal have similar distinctions between different rounding-rules?
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
For Website Payment Standard, there are no rules. You just pass all values as you want them charged.
However, it seems they do impose some rounding on totals, like withdrawls from your account to your bank, and apparently it has made at least this guy upset over his missing penny.
IIRC, php's number_format is doing the rounding.
Looking at some output from that function:
1.234 = $1.23
2.345 = $2.35
2.001 = $2.00
2.1 = $2.10
1.2345 = $1.23
Looks like it does "HALF_UP" rounding anyway...
So I guess the concern here is only for US stores, that you might display $5.01 on your opencart site, but Google might display $5.02 on their site?
However, it seems they do impose some rounding on totals, like withdrawls from your account to your bank, and apparently it has made at least this guy upset over his missing penny.
IIRC, php's number_format is doing the rounding.
Looking at some output from that function:
1.234 = $1.23
2.345 = $2.35
2.001 = $2.00
2.1 = $2.10
1.2345 = $1.23
Looks like it does "HALF_UP" rounding anyway...
So I guess the concern here is only for US stores, that you might display $5.01 on your opencart site, but Google might display $5.02 on their site?
Last edited by Qphoria on Wed Jan 07, 2009 8:51 pm, edited 1 time in total.
Also on the "round" php function, search for "half_even" and you will find user created functions for proper calculations:
http://www.php.net/round
But then do we trigger the rounding method based on
US = Half_Even
Non-US = Half_up
Are there other countries with rules too?
Perhaps we should include the user-made functions for half_up/down/even and set the rules to be configurable, kinda like how weight units are configurable, you can set the method by country as desired, with US and UK entered by default for you.
http://www.php.net/round
But then do we trigger the rounding method based on
US = Half_Even
Non-US = Half_up
Are there other countries with rules too?
Perhaps we should include the user-made functions for half_up/down/even and set the rules to be configurable, kinda like how weight units are configurable, you can set the method by country as desired, with US and UK entered by default for you.
Just thought I would add this here as I have just started using Opencart and come across this problem, I'm in New Zealand and we don't use any rounding for our tax. It's just a straight calculation. Our rate is currently 12.5% for all Goods and Services. I have a feeling that Australia is also similar (no rounding) but their rate is 10%.
I would like to agree with the suggestion of making the rounding rules user configurable.
Being that it won't be a quick fix, would someone be kind enough to point me in the direction of the file that does the rounding so that I can change it for my needs.
I would like to agree with the suggestion of making the rounding rules user configurable.
Being that it won't be a quick fix, would someone be kind enough to point me in the direction of the file that does the rounding so that I can change it for my needs.
how do you not round? you just show 3 or 4 decimal places whatever it takes? what if you wind up with a repeating number? and at that how do you manage to pay a fraction of your lowest denomination of currency? You have to round one way or the other.totall wrote:Just thought I would add this here as I have just started using Opencart and come across this problem, I'm in New Zealand and we don't use any rounding for our tax. It's just a straight calculation. Our rate is currently 12.5% for all Goods and Services. I have a feeling that Australia is also similar (no rounding) but their rate is 10%.
I would like to agree with the suggestion of making the rounding rules user configurable.
Being that it won't be a quick fix, would someone be kind enough to point me in the direction of the file that does the rounding so that I can change it for my needs.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
That is a very valid point, I know what I was thinking, we round to 2 decimal places.Xsecrets wrote: how do you not round? you just show 3 or 4 decimal places whatever it takes? what if you wind up with a repeating number? and at that how do you manage to pay a fraction of your lowest denomination of currency? You have to round one way or the other.
there are two rounding method bounding and unbounding
Unbiased Rounding
Round to nearest exact number
For 0.5 case, round so that result is even
o Example for integers
o 2.5 rounds to 2
o 3.5 rounds to 4
This avoids bias in rounding
Unbiased Rounding
Round to nearest exact number
For 0.5 case, round so that result is even
o Example for integers
o 2.5 rounds to 2
o 3.5 rounds to 4
This avoids bias in rounding
Who is online
Users browsing this forum: Ellen261Rister, Google [Bot], muko34 and 17 guests