Money convert at rate
money-convert-at-rate · version 1.0.0 · Money & pricing · free, no key needed
Convert an amount between two ISO 4217 currencies at a caller-supplied rate with explicit quote direction and rounding.
Use when you need to: convert 100 euros to dollars at 1.0843 · EUR/USD 1.0843 how many dollars is 250 euros · convert USD to EUR when the rate is quoted EUR/USD.
Decide before calling
Read the versioned contract and the supported scope below. Reuse money-convert-at-rate@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use money-convert-at-rate@1.0.0 for convert 100 euros to dollars at 1.0843. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- convert 100 euros to dollars at 1.0843
- EUR/USD 1.0843 how many dollars is 250 euros
- convert USD to EUR when the rate is quoted EUR/USD
- CFA franc to euro at 655.957
- convert yen to euros at a given rate rounded half even
- currency conversion with explicit rounding and output decimals
- convert Danish krone at the ERM II central rate
- apply an exchange rate to an invoice total
Not supported
- looking up live or historical exchange rates
- deriving a cross rate between two currencies
- bank spreads, fees or margins on the rate
- cryptocurrency or non-ISO units
Behavior
- The rate is always a caller input (the tool has no rate data). rate_direction "from_to" means 1 unit of from = rate units of to (EUR/USD 1.0843: from EUR to USD); "to_from" means 1 unit of to = rate units of from, so the effective rate is exactly 1/rate. rate must be a positive decimal (zero is invalid_input, reason rate_zero).
- from and to are 3-letter ASCII ISO 4217 codes (case-insensitive) that must be active and have a numeric minor unit; unknown, historic (DEM, HRK) and minor-unit-less codes (XAU, XDR) are unsupported_input. from equal to to is allowed. currency in the output is the to code upper-case.
- result = amount x effective rate, rounded ONCE at the output scale with the required rounding mode; the amount is not pre-rounded to the from-currency scale and the inverted rate is never rounded. The output scale is the optional scale (0..18) or, by default, the minor unit of the to currency (JPY 0, USD 2, KWD 3).
- The ten rounding modes act on the exact rational: half_even, half_up (ties away from zero), half_down, half_ceiling, half_floor, up, down, ceiling, floor, and unnecessary (an inexact result is not_computable, reason rounding_necessary). exact is true iff no rounding was needed.
- rate_from_to reports the effective from_to rate as a canonical decimal without trailing zeros: exact when it terminates within 20 fraction digits (rate_exact true), otherwise rounded half_even to 20 digits (rate_exact false). The amount always uses the unrounded rate.
- Decimal strings match ^-?(0|[1-9][0-9]*)(\.[0-9]+)?$ with at most 60 digits and 40 fraction digits (invalid_input); a string over 62 characters is limit_exceeded, checked before the syntax. amount is signed and not precision-checked against the from currency.
- Data is the pinned ISO 4217 snapshot named by data_version; no clock, locale or network.
- Disclaimer: arithmetic calculation only; not financial, tax, legal, or investment advice.
Input
amount(string, required): min length 1; max length 62; pattern^-?(0|[1-9][0-9]*)(\.[0-9]+)?$; Amount in thefromcurrency; any decimal (not restricted to the from-currency precision).from(string, required): min length 3; max length 3; pattern^[A-Za-z]{3}$; Source currency: active ISO 4217 code with a minor unit (case-insensitive).to(string, required): min length 3; max length 3; pattern^[A-Za-z]{3}$; Target currency: active ISO 4217 code with a minor unit (case-insensitive); its minor unit is the default output scale.rate(string, required): min length 1; max length 62; pattern^(0|[1-9][0-9]*)(\.[0-9]+)?$; Positive decimal exchange rate as quoted; zero is invalid.rate_direction(one of "from_to", "to_from", required): from_to: 1 unit offrom= rate units ofto. to_from: 1 unit ofto= rate units offrom.rounding(one of "half_even", "half_up", "half_down", "half_ceiling", "half_floor", "up", "down", "ceiling", "floor", "unnecessary", required)scale(integer, optional): min 0; max 18; Optional output fraction digits 0..18; default is the minor unit ofto.
Output
amount(string, required): min length 1; max length 400; pattern^-?(0|[1-9][0-9]*)(\.[0-9]+)?$; Converted amount at exactlyscalefraction digits.currency(string, required): pattern^[A-Z]{3}$; Thetocurrency, upper-case.scale(integer, required): min 0; max 18exact(boolean, required): true when the product needed no rounding.rate_from_to(string, required): min length 1; max length 400; pattern^-?(0|[1-9][0-9]*)(\.[0-9]+)?$; The rate as used, as units oftoper 1from, without trailing zeros; at most 20 fraction digits.rate_exact(boolean, required): false when the effective from_to rate was rounded to 20 fraction digits for display (the amount always uses the unrounded rate).data_version(constant "iso4217-datasets-7cdc784-2026-07-27", required)
Limits
- max decimal chars: 62
- max decimal digits: 60
- max fraction digits: 40
- max scale: 18
- max rate fraction digits reported: 20
Example
Request input:
{
"amount": "100",
"from": "EUR",
"to": "USD",
"rate": "1.0843",
"rate_direction": "from_to",
"rounding": "half_even"
}
Response:
{
"result": {
"amount": "108.43",
"currency": "USD",
"scale": 2,
"exact": true,
"rate_from_to": "1.0843",
"rate_exact": true,
"data_version": "iso4217-datasets-7cdc784-2026-07-27"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "money-convert-at-rate",
"version": "1.0.0",
"input": {
"amount": "100",
"from": "EUR",
"to": "USD",
"rate": "1.0843",
"rate_direction": "from_to",
"rounding": "half_even"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/money-convert-at-rate/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"amount":"100","from":"EUR","to":"USD","rate":"1.0843","rate_direction":"from_to","rounding":"half_even"}'
The machine-readable contract is at /v1/tools/money-convert-at-rate/versions/1.0.0.
CLI
node cli.mjs run money-convert-at-rate 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Vat net gross convert: Convert a net or gross amount at a VAT rate into a net, VAT and gross triple that adds up exactly at currency precision.
- Fx cross rate compute: Derive a cross exchange rate and its inverse from two quoted rates that share one currency, at a stated scale.
- Currency lookup: Look up an ISO 4217 alphabetic or numeric currency code: name, minor-unit exponent, entities, active or withdrawn.
- Decimal divide: Divide two decimal strings exactly, rounding the quotient once to a fixed scale, and report the exact remainder.
- Decimal sum: Add up to 10,000 decimal strings exactly and report count, smallest and largest, with optional final rounding.
- Discount stack apply: Apply an ordered stack of percent and fixed-amount discounts to a price, rounding each step or only at the end.