curatedapi

Currency rounding calculator

Round an amount to its currency's minor unit (ISO 4217: 2 decimals for EUR, 0 for JPY, 3 for KWD) and to a country's cash rounding rule, such as 0.05 in Canada.

The amount to round.
ISO 4217 code of the currency, such as USD, EUR, JPY or KWD. It sets the number of decimals (the minor unit): 2 for most currencies, 0 for JPY, 3 for KWD. At most 3 characters.
How to round to the currency's minor unit. half_up is the usual commercial rule (and the rule for euro conversions). Options: half_up: to nearest, ties away from zero (2.5 → 3, -2.5 → -3); half_even: to nearest, ties to even (2.5 → 2, 3.5 → 4): banker's rounding; half_down: to nearest, ties towards zero (2.5 → 2); up: away from zero (2.1 → 3, -2.1 → -3); down: towards zero, i.e. truncate (2.9 → 2); ceiling: towards +∞ (2.1 → 3, -2.1 → -2); floor: towards −∞ (2.9 → 2, -2.1 → -3)
Optional ISO 3166 two-letter country code, to also round the total for a cash payment by that country's rule. The currency must be the country's. Countries: AU (AUD), BE (EUR), BS (BSD), CA (CAD), CH (CHF), CL (CLP), CZ (CZK), DK (DKK), EE (EUR), FI (EUR), HU (HUF), IE (EUR), IL (ILS), IT (EUR), JM (JMD), LT (EUR), MY (MYR), NL (EUR), NO (NOK), NZ (NZD), SE (SEK), SK (EUR), TT (TTD). At most 2 characters.
Optional cash step of your own, such as 0.05 or 0.10, instead of cash_country. It must be a whole number of minor units.
Which way a cash total exactly halfway between two steps goes. The default is the country's rule; when the rule does not say (or with cash_step), up is used and a CASH_TIE_ASSUMED warning says so. Options: up: a total exactly halfway between two steps rounds away from zero; down: a total exactly halfway between two steps rounds towards zero

Examples

Example: Japanese yen have no decimals

Rounded
The amount in the currency's minor unit, with every decimal shown (10.50, 1050 for JPY, 1.235 for KWD).
1235
Minor units
The rounded amount as a whole number of minor units (1050 for 10.50 EUR), as a string so it stays exact. Most payment APIs take amounts in this form, though a few use other minor units than ISO 4217 for some currencies, so check yours.
1235
Decimals
The currency's ISO 4217 minor unit.
0
Currency name
The currency's English name.
Japanese yen
Difference
rounded − amount, exactly.
0.5

Calculator money/round@1.

How it is calculated

rounded = round(amount × 10^d) ÷ 10^d with d = ISO 4217 minor unit; cash = rounded to the nearest multiple of the step, ties and small totals per the country's rule

Rounds an amount of money the way the currency and the country require. First it rounds to the currency's minor unit from ISO 4217, the international list of currency codes: cents for USD and EUR, whole yen for JPY, three decimals for the Kuwaiti dinar. Then, if you give a country, it applies that country's rule for rounding cash totals in countries that have withdrawn their smallest coins, such as 0.05 in Canada, Australia and several euro countries, 0.10 in Israel, a whole krona in Sweden or 10 pesos in Chile. There are 23 countries, and every rule follows the country's law, central bank or government guidance, cited in the references, including the special cases: Finland and Estonia never round a total of 0.01 or 0.02 to zero, Slovakia rounds it up to 0.05, and Chile rounds 5 pesos down. You can also give your own cash step.

  • The amount is rounded to the minor unit first and the cash rule is applied to that, because prices and totals are always in whole minor units before cash rounding.
  • cash_rule says what the country's source requires, including whether rounding is mandatory or up to the shop, and whether card payments are rounded. Switzerland has no legal rule; its official guidance only allows rounding cash totals down, so CH always rounds down to 0.05.
  • Where a country's source does not say which way a total exactly halfway between two steps goes (New Zealand at 0.05, Denmark at 0.25 and 0.75, the Czech Republic at 0.50), it is rounded up with a CASH_TIE_ASSUMED warning unless you set cash_tie.
  • Cash rounding applies to the total to pay in cash, not to each item, and in most of these countries only to cash: card and bank payments are paid to the cent.
  • A negative amount (a cash refund) is rounded like the positive amount and made negative.
  • Codes without a minor unit in ISO 4217 (gold, silver, units of account such as XDR) are refused. Withdrawn codes such as BGN (replaced by the euro on 1 January 2026) are not accepted.

References

Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.

Use it from your code

POST /v1/calc/money/roundVersion 1
curl https://api.curatedapi.com/v1/calc/money/round \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "1234.5",
    "currency": "JPY"
  }'
The same call in Python
import os

import requests

payload = {
    "amount": "1234.5",
    "currency": "JPY",
}
response = requests.post(
    "https://api.curatedapi.com/v1/calc/money/round",
    headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
    json=payload,
    timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
    "amount": "1234.5",
    "currency": "JPY",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/money/round", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});
console.log((await response.json()).result);

MCP tool calc_money_round at https://mcp.curatedapi.com. Inputs, outputs and errors in the API reference.

Put it on your website

<div data-curatedapi-widget="money/round" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>

Use a public key registered for your site. Calculations are billed like API calls. How widgets work.

Related calculators

Round and split money to the cent in your app

Every share adds up to the total and every cash total follows the country's rule, so the ledger, the receipt and the payout agree.

Free for up to 1,000 payments a month. 50,000 payments a month cost $9.00 on the Starter plan.