0

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.

3

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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