0

I want to display price in two decimal points.

If I enter 38.3445 in special price than I want output in frontend as 38.35 or 38.00 . But Magento display as 38.34 . Magento counts upto 3 decimal points. But I want to make it count upto 4.

Same as I enter 38.4945 than I want output as 38.50 or 39.00 But magento display as 38.49.

I make following changes in 4 files to set 4 decimal points:-

1 File : m229/vendor/magento/zendframework1/library/Zend/Currency.php: Line no 74 set this : 'precision' => 4,

2 file : m229/vendor/magento/framework/Pricing/PriceCurrencyInterface.php : line no 19 : const DEFAULT_PRECISION = 4;

3 file : m229/vendor/magento/module-directory/Model/Currency.php : line no 280 : return $this->formatPrecision($price, 4, $options, $includeContainer, $addBrackets);

4 file : m229/vendor/magento/module-sales/Model/Order.php : line no 1711 : replace this function :

public function formatPrice($price, $addBrackets = false)
    {
        return $this->formatPricePrecision($price, 4, $addBrackets);
    }

Does anyone know how to do it? Thank you in advance...

Your Answer

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

Browse other questions tagged or ask your own question.