filter_exchange_rates
Look up a rate or convert a numeric amount with mod_exchange_rates.
{{ "EUR"|exchange_rates }}
{{ 100|exchange_rates:"EUR" }}
{{ 100|exchange_rates:"EUR":"USD" }}
With no arguments, the input is a currency code and the result is its rate in currency units per USD. With one argument, the input is an amount in USD and the argument is the destination currency. With two arguments, the first is the source currency and the second is the destination currency; the last example converts 100 EUR to USD.
Currency codes are case-insensitive for rate lookup. Translated currency
values are resolved using the current language fallback. Undefined inputs,
empty currency codes, unsupported tuple values and failed currency lookups
produce undefined. Amounts are converted with z_convert:to_float/1.
Cross-currency results follow the currency rounding rules of
mod_exchange_rates; identical currencies return the amount as a float.
The filter does not format a currency symbol or localized number and does
not perform an ACL check.