1

In Magento 2, how do we show prices in other currencies than the base currency rounded up?

For example, when foreign currencies are calculated using today's exchange rate, the price may be shown as $14.40. I want that to show as $15. How do I do that?

Thanks! :_)

lisali
  • 61
  • 2
  • 8

1 Answers1

3

vendor/magento/framework/pricing/amount/AmountFactory.php

public function create($amount, array $adjustmentAmounts = [])
{
    $amountModel = $this->objectManager->create(
        self::DEFAULT_PRICE_AMOUNT_CLASS,
        [
            'amount' => **round($amount)**,
            'adjustmentAmounts' => $adjustmentAmounts
        ]
    );

    if (!$amountModel instanceof \Magento\Framework\Pricing\Amount\AmountInterface) {
        throw new \InvalidArgumentException(
            get_class($amountModel) . ' doesn\'t implement \Magento\Framework\Pricing\Amount\AmountInterface'
        );
    }

    return $amountModel;
}
Siarhey Uchukhlebau
  • 15,957
  • 11
  • 54
  • 83
Saachi
  • 61
  • 5