10 use Psr\Log\LoggerInterface as Logger;
53 $currentCurrency = $this->
getCurrency($scope, $currency);
57 ->convert(
$amount, $currentCurrency);
65 $currentCurrency = $this->
getCurrency($scope, $currency);
66 $convertedValue = $this->
getStore($scope)->getBaseCurrency()->convert(
$amount, $currentCurrency);
67 return round($convertedValue, $precision);
75 $includeContainer =
true,
76 $precision = self::DEFAULT_PRECISION,
81 ->formatPrecision(
$amount, $precision, [], $includeContainer);
89 $includeContainer =
true,
90 $precision = self::DEFAULT_PRECISION,
96 return $this->
format(
$amount, $includeContainer, $precision, $scope, $currency);
104 if ($currency instanceof
Currency) {
105 $currentCurrency = $currency;
106 }
elseif (is_string($currency)) {
107 $currency = $this->currencyFactory->create()
109 $baseCurrency = $this->
getStore($scope)
111 $currentCurrency = $baseCurrency->getRate($currency) ? $currency : $baseCurrency;
113 $currentCurrency = $this->
getStore($scope)
114 ->getCurrentCurrency();
117 return $currentCurrency;
127 return $this->
getCurrency($scope, $currency)->getCurrencySymbol();
139 if (!$scope instanceof
Store) {
140 $scope = $this->storeManager->getStore($scope);
142 }
catch (\Exception $e) {
143 $this->logger->critical($e);
144 $scope = $this->storeManager->getStore();
elseif(isset( $params[ 'redirect_parent']))
format( $amount, $includeContainer=true, $precision=self::DEFAULT_PRECISION, $scope=null, $currency=null)
convertAndRound($amount, $scope=null, $currency=null, $precision=self::DEFAULT_PRECISION)
__construct(StoreManagerInterface $storeManager, CurrencyFactory $currencyFactory, Logger $logger)
convert($amount, $scope=null, $currency=null)
getCurrency($scope=null, $currency=null)
convertAndFormat( $amount, $includeContainer=true, $precision=self::DEFAULT_PRECISION, $scope=null, $currency=null)
getCurrencySymbol($scope=null, $currency=null)