You are here

currency_units.module in Units of Measurement 6

Implementation of Units module API for currency units.

File

modules/currency_units.module
View source
<?php

/**
 * @file
 * Implementation of Units module API for currency units.
 */

/**
 * Implementation of hook_define_units()
 * 
 */
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;
}

Functions

Namesort descending Description
currency_units_define_units Implementation of hook_define_units()