cancel
Showing results for 
Search instead for 
Did you mean: 

Tax & decimal rounding method

Tax & decimal rounding method

Feature request from HirokazuNishi, posted on GitHub May 06, 2015

Magento1.x only uses "round" for tax and decimal number method, but sometimes it causes wrong result. Also some merchants use "floor" and "ceil" for discarding decimal numbers.

Is it possible to choose decimal discarding method via admin panel for M2? If we do simply discard decimal numbers, converting currencies causes serious trouble.

For example, 99.99USD is 11,961.15JPY ( 1USD is 119.6235JPY ), but JPY does not use under decimal number. Then correct result is 11,961 JPY. If "round" is used for discarding method, sometimes converting result is not correct.

4 Comments
Not applicable

Comment from yoavkutner, posted on GitHub May 06, 2015

+1

Not applicable

Comment from choukalos, posted on GitHub May 06, 2015

Hey @HirokazuNishi in Magento 2 the rounding function should be consolidated for tax. Should be fairly straight forward to do a plugin and replace that with floor or ceil or even bankers rounding to enable one to create country/taxation specific extension.

As far as choosing the # of decimal places there's a couple constants that really need to be consolidated + the automated test framework used by tax/pricing tests could use some attention to be adapted to changes in # of decimal places. If you could do that and send in a PR that'd be awesome! That would enable all sorts of community driven extensions around taxes/pricing.

Thanks, Chuck

Not applicable

Comment from HirokazuNishi, posted on GitHub May 06, 2015

@choukalos Of course I'll try to make PR, but I just started to investigation about this issue on M2. so it takes long time. I already released one extension to solve this issue on M1, but I had to rewrite many classes and had to execute many tests. If M2 aims to be real cross-border ecommerce platform, decimal & tax issues should be solved before stable release.

Not applicable

Comment from choukalos, posted on GitHub May 07, 2015

@HirokazuNishi after you finish investigating please ping me if there are things we can do in core to make it easier to create custom tax extension. One of our goals in the M2 tax engine was to make it easy to replace or customize.