K
Docs
💱

Convert Currency

info.currencyThe AlmanacLook-ups

Converts an amount between currencies using the European Central Bank's daily reference rates — about 30 major currencies. Codes like USD and words like “euros” or “£” both work. {{money.text}} is the result written properly, like €89.57.

When to use this
  • →Rates are updated once per working day — {{money.date}} says which day
  • →{{money.result}} is the plain number, for Math or the Vault

On the canvas

This is what Convert Currency looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

💱
Convert Currency
info.currency
Look-ups
amount
e.g. {{input.options.amount}} (empty = 1)
fromrequired
e.g. USD or {{input.options.from}}
torequired
e.g. EUR or {{input.options.to}}
asrequired
money
output
invalid
error

Config fields

FieldTypeReqWhat it does
amount
e.g. {{input.options.amount}} (empty = 1)
text—How much 💰
from
e.g. USD or {{input.options.from}}
textyesFrom 🏦
to
e.g. EUR or {{input.options.to}}
textyesTo 🏦
as
money
textyesSave it as ✨

Sparks this piece adds

After this piece runs, these values are available as sparks in every node downstream.

{{money.summary}}string“$100.00 = €89.57”
{{money.text}}stringThe result written as money, like €89.57
{{money.result}}numberThe result as a plain number
{{money.rate}}numberThe exchange rate used
{{money.from}}stringFrom currency code, like USD
{{money.to}}stringTo currency code, like EUR
{{money.fromName}}stringFrom currency name, like US Dollar
{{money.toName}}stringTo currency name, like Euro
{{money.date}}stringWhich day's rates were used
{{money.error}}stringWhy it couldn't be looked up

Output ports

outputConverted — {{money.summary}} reads “$100.00 = €89.57”
invalidNot a currency the bank publishes, or not an amount — {{money.error}} says which
errorThe rates couldn't be fetched right now
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
const res = await fetch("https://api.frankfurter.dev/v1/latest?base=USD");
const { rates, date } = await res.json();
const result = Math.round(100 * rates.EUR * 100) / 100; // {{money.result}}
const text = new Intl.NumberFormat("en-US", { style: "currency", currency: "EUR" }).format(result);
await interaction.editReply(`💱 $100.00 = ${text}`); // {{money.summary}}