0

How to add third decimal point to products, orders, tax, shipping price in both frontend and backend ?

Ex:

Product: 12.55$   ==>   12.550$
0

In Magento2, there are different ways you can get this,

by Using this code inside your view file(.phtml)

$this->helper('Magento\Framework\Pricing\Helper\Data')->currency(number_format(7,3),true,false);

This means there can be 7 digits to the left of the decimal point (7-3) and 3 to the right of the decimal point.

OR

This worked in Magento 2.1: Look in

/vendor/magento/framework/Pricing/PriceCurrencyInterface.php

Change const DEFAULT_PRECISION = 2;

To const DEFAULT_PRECISION = 3;

Edit For this you could go for module like this one.

Then flush cache.

Hope this will help.

  • For first solution Which files i can edit? Also, I tried the second solution, it changed the product prices in fronend only. – Jsparo30 May 3 '17 at 12:04
  • You want to change the price in back-end too? – Lalit838 May 3 '17 at 12:11
  • Yes, for prducts, orders, shipping ... – Jsparo30 May 3 '17 at 12:12
  • (i have edited my question) For this you should checkout the module for magento2.1 go for this link github.com/lillik/magento2-price-decimal – Lalit838 May 3 '17 at 12:28
  • Please, Which link? – Jsparo30 May 3 '17 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.