Advertising sustains the DA. Ads are hidden for members. Join today

Currency Exchange

Last updated on
30 April 2025

You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules

Currency exchange rates are completely pluggable. All exchange rates are numeric strings. Use PHP's BCMath extension to perform calculations on those strings. Example:

$amount_from = '9.95';
$exchange_rate = CurrencyExchanger::load('EUR', 'UAH');
$amount_to = bcmul($exchange_rate, $amount_from);

Help improve this page

Page status: Not set

You can: