We want to Remove the decimal number from price in Magento 2.3 ex. 100.00$ to be 100$.
Anyone know how to do it? Thanks in advance.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityWe want to Remove the decimal number from price in Magento 2.3 ex. 100.00$ to be 100$.
Anyone know how to do it? Thanks in advance.
You need to override vendor/magento/module-catalog/view/base/web/js/price-utils.js
and change the value of precision on line 38:
from
var precision = isNaN(format.requiredPrecision = Math.abs(format.requiredPrecision)) ? 2 : format.requiredPrecision,
to
var precision = 0,
Or using number_format or round funciton of php like this:
$price = 100.00; number_format($price, 0, '.', ''); result : 100
For more please check this link:
or use this extension: https://github.com/lillik/magento2-price-decimal