# Magento 1.9 tier discount precision

We have a Problem with differences in the total price of the order between our Magento Webshop and ERP.

For example Magento (in our case 1.9.4.0) calculates this way:

• 7.85 € (product price) - 5% (tier disc. for 5 pcs) = 7.4575 € => 7.46 € (will be rounded now)
• 7.46 € (tier price) x 100 pcs (qty) = 746.00 € (position total)

But our german ERP calculates this way:

• 7.85 € (product price) - 5% (tier disc. for 5 pcs) = 7.4575 €
• 7.4575 € (tier price) x 100 pcs (qty) = 745.75 € (position total) => 745.75 € (will be rounded now)

Result for the order item total:

• Mage: 746.00 € => more or less 5% discount ( 4.97% )
• ERP: 745.75 € => exactly 5% discount

My reflections:

It could be a solution to...

• ...increase the precision of the tier prices from 2 decimal places to X
• ...use percentage tier discounts instead of amounts.

Questions:

1. Is there a parameter in the magento configuration to increase the precision of the tier prices? ...or another easy way?
2. Do you have a recommendation for a module, which allows percentage tier discounts, calulates with all decimal places and rounds the item total at the end?

Thanks and best regards,

Chris

– sv3n
Commented Apr 29, 2019 at 22:30
• See below your answer. :-) Commented May 2, 2019 at 7:44

Also german market ....

That price rounding was a problem since beginning, at least if you work with different tax calculation settings (incl. and excl. VAT for differnt stores).

We solved it with changing rounding to 4 decimals ... just have rewrite two methods:

• `Mage_Core_Model_Store::roundPrice(\$price)`
• `Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price::getEscapedValue(\$index = null)`

This works for normal prices. Tier/group prices are still displayed with 2 decimals, but are correctly calculated with 4 decimals. If it works for you i can share "mini-extension" code.

• Hi @sv3n, there is time to reply, but sometimes I get a little busy. ;-) I think your suggestion can help us, so I asked our developer to take a closer look. Nevertheless, it would be great if you could provide us with the mini extension. Thanks and bet regards, Chris Commented May 2, 2019 at 7:43
• @Chris added link ... if there are any problem pls raise an issue.
– sv3n
Commented May 26, 2019 at 20:32
• Thanks! We'll take a look. :-) Commented Jun 7, 2019 at 12:53