Skip to content
Keyboard shortcuts
Esc
Everywhere
Search the site
⌘K
Search the site
/
Show these shortcuts
?
Close what is open
Esc
Talk to us

FX conversion & gain/loss

Convert at your policy rate and measure the FX gain or loss.

FX conversion & gain/loss, worked

Loading the tool…

Arithmetic only — not tax, accounting, legal or investment advice. Check against current rules.

How the FX conversion & gain/loss works.

FX conversion with a rate you type between two named currencies, each at its own scale, plus realized / unrealized FX gain-loss (signed by whether the item is a receivable or a payable)

Quoted from the toolbelt spec, the document this tool was built against.

Where these numbers come from.

Negatives are parenthesized because that’s what a statement does. The rest is four promises.

  • Minor units, never floats

    Amounts are integers in the currency's smallest unit, end to end. A float never touches a cent.

  • Rounded in the right place

    Rounded where an invoice or a ledger would round, never operand by operand, so a split still sums to the whole. A tool that rounds each period says so.

  • Unit tested

    The arithmetic lives in one unit-tested module, and the extension uses the same one.

  • No network

    There is no request to make. What you type stays in this tab and is gone when you close it.

More in money math

The same number, elsewhere.

A calculator answers the question once. These carry the answer into a product, name what it computed, and argue the method.