This project is not covered by Drupal’s security advisory policy.

API module, used for displaying correctly formatted prices.

To use in your code;

  • Where $price is a price.
  • And $currency_code is a CURRENCY CODE, eg. GBP or USD.

<?php print theme('format_currency', $price, $currency_code); ?>

The module also (optionally) integrates with the currency_api module, so if for example you wanted to show how many EUROS you'd have when exchanging GBP £100;

  • $base indicates the base currency of the given price.
  • The $currency_code parameter is always the currency which will be shown.
<?php $price = 100; ?>
<?php $currency_code = 'EUR'; ?>
<?php $base = 'GBP'; ?>
<?php print theme('format_currency', $price, $currency_code, $base); ?>

NOTE: This module is a BETA release. Code-wise it is fine to use on production sites - it's in BETA as a lot of currencies do not have complete configuration yet and (unsurprisingly) the defaults do not suit every one... If you want to get involved, take a look at the format_currency.config.inc file and post your patches to the issue queue.

Supporting organizations: 
Development, conception.

Project information

Releases