Live currency exchange rates from CurrencyFreaks (USD base). The machinery behind the generated
commensura.currency unit fns: fetch (cached, TTL) → an exact code -> USD-value mapping → a unit.
Live-only: rates aren't shipped (they're volatile and proprietary), so this needs the user's own
key — set CURRENCYFREAKS_API_KEY (a free tier exists). A missing key or a fetch failure throws.
Rates are kept exact (rationals); each currency is worth (usd-value code) · dollar.
Live currency exchange rates from CurrencyFreaks (USD base). The machinery behind the generated `commensura.currency` unit fns: fetch (cached, TTL) → an exact `code -> USD-value` mapping → a unit. Live-only: rates aren't shipped (they're volatile and proprietary), so this needs the user's own key — set `CURRENCYFREAKS_API_KEY` (a free tier exists). A missing key or a fetch failure throws. Rates are kept exact (rationals); each currency is worth `(usd-value code) · dollar`.
(of code)(of code amount)The current currency unit for code, or amount of it — what the generated commensura.currency
fns delegate to. Also the way to reach a code that has no generated var.
The current currency unit for `code`, or `amount` of it — what the generated `commensura.currency` fns delegate to. Also the way to reach a code that has no generated var.
The current {code -> rate} map (units of code per 1 USD), cached with a TTL via core.memoize.
The memoized fn is the seam — with-redefs it in tests; a live fetch happens at most once per ttl-ms.
The current `{code -> rate}` map (units of `code` per 1 USD), cached with a TTL via core.memoize.
The memoized fn is the seam — `with-redefs` it in tests; a live fetch happens at most once per `ttl-ms`.(supported? nm)Is nm a supported currency code?
Is `nm` a supported currency code?
Rate-cache TTL in ms (default 12h). CurrencyFreaks' free tier is daily / 1,000 calls a month, so a long TTL keeps well under quota; redefine it if you have a faster paid plan.
Rate-cache TTL in ms (default 12h). CurrencyFreaks' free tier is daily / 1,000 calls a month, so a long TTL keeps well under quota; redefine it if you have a faster paid plan.
(unit code)A currency Unit for code — callable, worth (usd-value code) · dollar, dims {:currency 1}.
Minted fresh each call (the rate is live).
A currency Unit for `code` — callable, worth `(usd-value code) · dollar`, dims `{:currency 1}`.
Minted fresh each call (the rate is live).(usd-value code)The USD value of one unit of code (= 1 / rate). USD is 1 without a fetch.
The USD value of one unit of `code` (= 1 / rate). `USD` is 1 without a fetch.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |