# filter\_exchange\_rates

Source: https://zotonic.com/docs/3102/filter_exchange_rates

URI: https://zotonic.com/id/3102

Language: en



Look up a rate or convert a numeric amount with `mod_exchange_rates`.

```django
{{ "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.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/3102?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/3102?language=en>)
