You are here

function currency_api_get_desc in Currency 7

Same name and namespace in other branches
  1. 5 currency_api/currency_api.module \currency_api_get_desc()
  2. 6 currency_api/currency_api.module \currency_api_get_desc()

Currency exchange API function.

This function gets the currency name for a standard ISO 3-letter codes, You can find the details here: http://www.oanda.com/site/help/iso_code.shtml

Here is an example on how to use it:

$ccode = 'CAD'; $ret = currency_get_description($ccode); if ($ret == FALSE) { drupal_set_message(t('Could not get description')); } else { print $ccode .' => '. $ret; }

Parameters

string $currency: Currency code (3-letter ISO).

Return value

$result Contains FALSE if the currency cannot be found, otherwise, it has the description.

2 calls to currency_api_get_desc()
currency_api_convert in currency_api/currency_api.module
Currency exchange rate API function.
theme_currency_result in ./currency.module
Theme implementation for currency exchange result.

File

currency_api/currency_api.module, line 266
This module provides an API for currency conversion.

Code

function currency_api_get_desc($currency) {
  $list = currency_api_get_list();
  if (isset($list[$currency])) {
    return $list[$currency];
  }
  return FALSE;
}