1

How can you set in Magento2 that all the calculations you make on orders, invoices, price rules,…, to be done with 2 decimals not with 4 decimals?

Attention, I mean the calculation of prices and not the display of prices.

1 Answer 1

0

Follow the path /vendor/magento/module-tax/Model/Calculation/AbstractCalculator.php In the deltaRound() method, we need to remove the following code:

if ($round) {
    $roundPrice = $this->calculationTool->round($roundPrice);
}

Some methods by which that code can be removed:

  • Class extension
  • Create Plugin
  • Create Patch

Or the permanent declaration of the $round parameter as false.

$round = false

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.