Magento How to set a product price to 4 decimal places

For a store in the UK or Europe, we must show prices for VAT. those. a product sold for Β£ 15.95 in a store will be kept by the administrator as Β£ 13.5744, so when VAT is added (17.5%) it will be Β£ 15.95

Unfortunately, Mag seems to save only 2dp. Even you enter 13.5744 in the admin for the price - you get 13.57 when upgrading.

Is it possible to save the price of the administrator product in 4dp, and in the external interface we show 2dp ?.

Greetings

+7
source share
3 answers

From my point of view, you need to carefully read lib / Zend / Currency.php

Further research you will need to adjust the accuracy to 4 instead of 2:

http://framework.zend.com/manual/1.12/en/zend.currency.options.html
( edit: updated link to the latest available version)

In this thread there is more detailed information about the implementation such as well, it seems that Magento also does some formatting of the price there too:

http://www.magentocommerce.com/boards/viewthread/16337/

Application / code / kernel /Mage/Adminhtml/Block/Catalog/product/Helper/Form/Price.php

return number_format($value, 4, null, ''); 

I know this is not the final answer, but I hope it will lead you in the right direction.

+10
source

There is also a function roundPrice (), which can also be updated. This can be found in the file app / code / core / Mage / Core / Model / Store.php

If you are still stuck.

+1
source

For those who do not want to change the Magento code, the free CurrencyManager extension is available that can do this.

0
source

All Articles