You are here

function currency_units_define_units in Units of Measurement 6

Implementation of hook_define_units()

File

modules/currency_units.module, line 12
Implementation of Units module API for currency units.

Code

function currency_units_define_units() {
  $items = array();
  $currencies = currency_api_get_currencies();
  foreach ($currencies as $id => $currency) {
    $unit_id = 'currency_' . strtolower($id);
    $items[$unit_id] = array(
      'category_id' => 'currency',
      'category' => t('World Currencies'),
      'shortname' => $id,
      'fullname' => $currency['name'],
      'symbol' => $currency['symbol'],
      'decimals' => $currency['decimals'],
    );
  }
  return $items;
}