PHP Interface WellCommerce\Bundle\CurrencyBundle\Helper\CurrencyHelperInterface

Author: Adam Piotrowski ([email protected])
Show file Open project: wellcommerce/wellcommerce Interface Usage Examples

Public Methods

Method Description
convert ( float $amount, string $baseCurrency = null, string $targetCurrency = null, integer $quantity = 1 ) : float Converts the amount between currencies
convertAndFormat ( float $amount, string $baseCurrency = null, string $targetCurrency = null, integer $quantity = 1, string $locale = null ) : string Firts converts and then formats the amount
format ( float $amount, string $currency = null, string $locale = null ) : string Formats the given amount
getCurrencyRate ( string $baseCurrency = null, string $targetCurrency = null ) : float Returns the exchange rate

Method Details

convert() public method

Converts the amount between currencies
public convert ( float $amount, string $baseCurrency = null, string $targetCurrency = null, integer $quantity = 1 ) : float
$amount float
$baseCurrency string
$targetCurrency string
$quantity integer
return float

convertAndFormat() public method

Firts converts and then formats the amount
public convertAndFormat ( float $amount, string $baseCurrency = null, string $targetCurrency = null, integer $quantity = 1, string $locale = null ) : string
$amount float
$baseCurrency string
$targetCurrency string
$quantity integer
$locale string
return string

format() public method

Formats the given amount
public format ( float $amount, string $currency = null, string $locale = null ) : string
$amount float
$currency string
$locale string
return string

getCurrencyRate() public method

Returns the exchange rate
public getCurrencyRate ( string $baseCurrency = null, string $targetCurrency = null ) : float
$baseCurrency string
$targetCurrency string
return float