Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
PriceCurrencyInterface Interface Reference
Inheritance diagram for PriceCurrencyInterface:
PriceCurrency

Public Member Functions

 convert ($amount, $scope=null, $currency=null)
 
 convertAndRound ($amount, $scope=null, $currency=null, $precision=self::DEFAULT_PRECISION)
 
 format ( $amount, $includeContainer=true, $precision=self::DEFAULT_PRECISION, $scope=null, $currency=null)
 
 convertAndFormat ( $amount, $includeContainer=true, $precision=self::DEFAULT_PRECISION, $scope=null, $currency=null)
 
 round ($price)
 
 getCurrency ($scope=null, $currency=null)
 
 getCurrencySymbol ($scope=null, $currency=null)
 

Data Fields

const DEFAULT_PRECISION = 2
 

Detailed Description

Interface PriceCurrencyInterface

@api

Since
100.0.2

Definition at line 15 of file PriceCurrencyInterface.php.

Member Function Documentation

◆ convert()

convert (   $amount,
  $scope = null,
  $currency = null 
)

Convert price value

Parameters
float$amount
null | string | bool | int | \Magento\Framework\App\ScopeInterface$scope
\Magento\Framework\Model\AbstractModel | string | null$currency
Returns
float

Implemented in PriceCurrency.

◆ convertAndFormat()

convertAndFormat (   $amount,
  $includeContainer = true,
  $precision = self::DEFAULT_PRECISION,
  $scope = null,
  $currency = null 
)

Convert and format price value

Parameters
float$amount
bool$includeContainer
int$precision
null | string | bool | int | \Magento\Framework\App\ScopeInterface$scope
\Magento\Framework\Model\AbstractModel | string | null$currency
Returns
string

Implemented in PriceCurrency.

◆ convertAndRound()

convertAndRound (   $amount,
  $scope = null,
  $currency = null,
  $precision = self::DEFAULT_PRECISION 
)

Convert and round price value

Parameters
float$amount
null | string | bool | int | \Magento\Framework\App\ScopeInterface$scope
\Magento\Framework\Model\AbstractModel | string | null$currency
int$precision
Returns
float

Implemented in PriceCurrency.

◆ format()

format (   $amount,
  $includeContainer = true,
  $precision = self::DEFAULT_PRECISION,
  $scope = null,
  $currency = null 
)

Format price value

Parameters
float$amount
bool$includeContainer
int$precision
null | string | bool | int | \Magento\Framework\App\ScopeInterface$scope
\Magento\Framework\Model\AbstractModel | string | null$currency
Returns
float

Implemented in PriceCurrency.

◆ getCurrency()

getCurrency (   $scope = null,
  $currency = null 
)

Get currency model

Parameters
null | string | bool | int | \Magento\Framework\App\ScopeInterface$scope
\Magento\Framework\Model\AbstractModel | string | null$currency
Returns
\Magento\Framework\Model\AbstractModel

Implemented in PriceCurrency.

◆ getCurrencySymbol()

getCurrencySymbol (   $scope = null,
  $currency = null 
)
Parameters
null | string | bool | int | \Magento\Framework\App\ScopeInterface$scope
\Magento\Framework\Model\AbstractModel | string | null$currency
Returns
string

Implemented in PriceCurrency.

◆ round()

round (   $price)

Round price

Parameters
float$price
Returns
float

Implemented in PriceCurrency.

Field Documentation

◆ DEFAULT_PRECISION

const DEFAULT_PRECISION = 2

Default precision

Definition at line 20 of file PriceCurrencyInterface.php.


The documentation for this interface was generated from the following file: