How to change the price format to Indian price format in Magento 2
Example:
Price display like 453,453, want to display in the indian manner like 4,53,450
How to change the price format to Indian price format in Magento 2
Example:
Price display like 453,453, want to display in the indian manner like 4,53,450
2
Answers
File path: vendor/magento/zendframework1/library/Zend/Locale/Data/en.xml
On line number 3353, under section currencyFormat and type = "standard", change the pattern from
<pattern>¤#,##0.00</pattern>
to<pattern>¤ #,##,##0.00</pattern>
Still, on PDP page and cart page summary the price format does not change because the prize format is coming from the js in which Magento using a RegExp function for only US price format. For that, please change the code in the below file.
File path: vendor/magento/module-catalog/view/base/web/js/price-utils.js (First extend this file in your theme directory and do the respected changes.)
Under the function formatPrice below this line comment all the line in the respective function.
And add this set of code below the above line.
deploy and `rm -rf var/cache/*
Done
Example: A price previously displayed like 453,453, will now display in the Indian manner like 4,53,453.
@satyavir, I suggest you to do not change the core files of the magento, create your own module add en.xml file.
Well magento 2 is now supporting INR also, still you need modification then you can follow your above steps.