问题
I'm using magento 1.9.1.0, and HUF curency that has no cents. If i don't use discount there is no rounding error, but if i do use inside magento it calculates well:

But as soon as I try to use paypal to pay it i get the following error:

<img src="https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image&buttontype=ecshortcut&locale=en_US&ordertotal=5326.80&pal=XXXXX" alt="Checkout with PayPal" title="Checkout with PayPal">
and the ordertotal is wrong! In the Order is 5327 while in the Paypal button is 5326.80. its 0.20 off. It should round up, with no decimals. And no matter what i set, if a discount is used the rounding is all ways off!
The locale is wrong as well, even thought Hungary is set as a locale in magento.
How can I fix this rounding issues?
回答1:
Very often, some magento tax configurations don't play nicely with discount rules - particularly where PayPal is involved.
Within SYSTEM > CONFIGURATION check config under SALES -> TAX is set to 'apply customer tax AFTER discount', and not before. This fixed the issue for me.
Magento have a great page on their knowledge base explaining all the tax/discount configurations which can cause rounding errors: http://www.magentocommerce.com/knowledge-base/entry/magento-ce-18-ee-113-tax-calc
回答2:
Have you tried to change the Mage_Core_Model_Store::roundPrice(), and set the round to 0 decimal places.
来源:https://stackoverflow.com/questions/28902138/magento-paypal-rounding-issue-with-discount