function commerce_currency_load in Commerce Core 7
Returns a single currency array.
Parameters
$currency_code: The code of the currency to return or NULL to return the default currency.
Return value
The specified currency array or FALSE if it does not exist.
11 calls to commerce_currency_load()
- commerce_currency_amount_to_decimal in ./
commerce.module - Converts a price amount to a decimal value based on the currency.
- commerce_currency_convert in ./
commerce.module - Converts a price amount from a currency to the target currency based on the current currency conversion rates.
- commerce_currency_decimal_to_amount in ./
commerce.module - Converts a price amount to an integer value for storage in the database.
- commerce_currency_format in ./
commerce.module - Formats a price for a particular currency.
- commerce_line_item_handler_area_line_item_summary::render in modules/
line_item/ includes/ views/ handlers/ commerce_line_item_handler_area_line_item_summary.inc - Render the area.
File
- ./
commerce.module, line 487 - Defines features and functions common to the Commerce modules.
Code
function commerce_currency_load($currency_code = NULL) {
$currencies = commerce_currencies();
// Check to see if we should return the default currency.
if (empty($currency_code)) {
$currency_code = commerce_default_currency();
}
return isset($currencies[$currency_code]) ? $currencies[$currency_code] : FALSE;
}