0

In app/design/frontend/Vendor/Theme/Magento_ConfigurableProduct/templates/product/price/final_price.phtml of listing page price is appearing like ₹50.00 . I want to show it as ₹50.

I tried using

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

and

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

but it gives ₹50.00 and not ₹50. How I can achieve that?

amitshree
  • 7,006
  • 12
  • 63
  • 116

1 Answers1

2

To correct the product page you also should modify next javascript:

/vendor/magento/module-catalog/view/base/web/js/price-utils.js

on line 38 change

var precision = isNaN(format.requiredPrecision = Math.abs(format.requiredPrecision)) ? 2 : format.requiredPrecision,

for

var precision = 0,

Hope this help.

I found this in: Magento 2 : How to remove decimal points from the price

also another free extension available magento2-price-decimal

Rakesh Donga
  • 5,344
  • 2
  • 24
  • 57