Currency Minor Unit Lint for Payment API Amounts

Finds the money lines that send the wrong amount to a payment API: the x100 that charges 100x in JPY, the toFixed(2) that truncates KWD, and the currency codes that stopped being legal tender.

Install free

Free for the file open in your editor - no key, no limit. The workspace sweep and the report ask for a key.

Open VSX (Cursor, VSCodium)npmMCP server (npx)Docker Hub
npx @readystack/currency-minor-unit-lint <file>
npx @readystack/currency-minor-unit-lint --mcp
docker run --rm -v "$PWD:/w" getreadystack/currency-minor-unit-lint /w

Team? One key for every ReadyStack linter, 5 seats, $149 once

Get the full rule table as a PDF
All 24 rules Currency Minor Unit Lint checks, each with its source and date, on printable pages you can hand to your team or auditor. We email it now, and once more only if a rule changes. No newsletter.

Get the complete version $29

This page is the working piece. The full pack has everything below.

Finds the money lines that send the wrong amount to a payment API: the x100 that charges 100x in JPY, the toFixed(2) that truncates KWD, and the currency codes that stopped being legal tende

Payment processors publish a $15.00 fee for every dispute received, and it is not returned when you lose the dispute.

Buy the full version — $29
ENDEJAESPT

Find a tool

· ReadyStack

Worked example

Real numbers from this tool, line by line.

Six money lines in this checkout file charge the wrong amount, and every test passes

Six of the money lines below send an amount the payment API reads differently from what the backend engineer in Sofia, Tokyo or Kuwait City meant - and nothing fails, because every one of them is valid code.

line  3  [error]  Math.round(x * 100) charges 100x in the 16 zero-decimal currencies (JPY, KRW, VND...)
line  5  [info]   Zero-decimal currency: 500 JPY is amount 500 - the * 100 above charges 100x here
line  6  [error]  BGN stopped being legal tender on 2026-02-01. Charge EUR (1 EUR = 1.95583 BGN)
line  7  [error]  amount is a decimal literal - 10.99 is read as 10 or rejected outright
line  7  [warn]   KWD is a 3-decimal currency: 1.5 is 1500, not 150, and the last digit must be 0
line  8  [warn]   ISK needs a two-decimal value ending in 00 - 5 ISK is amount 500
line 10  [warn]   Math.round on a float tax rounds 1.005 down to 1 (it is stored as 1.00499999999999989)
line 11  [error]  toFixed(2) prints 1200.00 for JPY and truncates KWD 1.234 to 1.23
--- 15 findings over 8 lines, from 24 rules ---

The line every assistant writes

const amount = Math.round(price * 100);

This is correct for the dollar, the euro and the pound. It is wrong for the sixteen currencies that have no minor unit at all - BIF, CLP, DJF, GNF, JPY, KMF, KRW, MGA, PYG, RWF, UGX, VND, VUV, XAF, XOF and XPF. In those currencies the amount is the charge: 500 JPY is the integer 500. Multiply by a hundred and a 5,000 yen order bills 500,000 yen.

It is wrong in the other direction for the currencies with three decimals - BHD, IQD, JOD, KWD, LYD, OMR and TND. Those amounts are in thousandths, and processors additionally require the last digit to be zero. Sending 150 for KWD 1.5 undercharges by a factor of ten on every invoice.

The code that stopped being true on a date

Bulgaria adopted the euro on 1 January 2026 at the fixed rate of 1 EUR = 1.95583 BGN. The lev and the euro circulated together through January, and since 1 February 2026 the euro has been the sole legal currency. currency: "bgn" is not a style choice any more; it is a code that a processor will refuse.

Croatia did the same on 1 January 2023 at 1 EUR = 7.53450 HRK. VEF became VES, MRO became MRU, STD became STN, SLL became SLE, ZWL became ZWG. Every one of those is still sitting in somebody's config file, because a retired currency code is a perfectly valid three-character string until the API answers.

Why the assistant cannot catch this

Ask a coding assistant whether Math.round(price * 100) is right and it will say yes, because for the currency it was shown most often it is. Ask it whether BGN is a live currency code and it will say yes, because it learned a world in which it was. The blind spot is not carelessness - it is the training date, and it is exactly the same date the code was written on.

Nor does the test suite help. Math.round(19.99 * 100) returns 1999 whatever currency you attach to it. The number is only wrong once it reaches the processor, and by then it is a refund, a dispute and a support thread.

What the rules check

Twenty-four rules, each one checkable:

Checking the file you have open is free: all twenty-four rules, every finding, nothing hidden and no watermark. The licence key covers the other job - every file in the repository, a CI gate that fails the build before a wrong amount can merge, a CSV, JSON or HTML report, and rewriting the retired codes in place. $29 once, 7-day full refund.

15 seconds — what it actually does

Questions people ask

What does Currency Minor Unit Lint actually do?

It reads the file you have open and flags every line that builds a money amount the payment API will read differently from what you meant. Each finding gives the line number, the currency, its ISO 4217 exponent and, where a country changed codes, the date. It ships 24 rules.

Who is this for?

Backend and platform engineers who write the charge call - the person who owns the repository the day finance asks why a Tokyo customer was billed a hundred times the price. It is aimed at teams selling into Japan, Korea, the Gulf states or the euro countries that recently switched currency codes.

Why can I not just ask a chatbot whether my amount code is right?

Because the assistant writes Math.round(price * 100), which is correct for dollars and euros and wrong for the sixteen zero-decimal currencies. And it was trained before Bulgaria adopted the euro on 2026-01-01, so it still confirms BGN as a live currency code - the lev stopped being legal tender on 2026-02-01. A dated table does not have that blind spot.

What is free and what needs a licence key?

Checking the open file is free and complete: all 24 rules run, every finding shows the currency and the date, and nothing is hidden or watermarked. The licence covers a different job - scanning every file in the repository, failing a CI build, exporting a report, and rewriting retired codes in place.

What does this cost compared with getting it wrong once?

The extension is 29 US dollars once,. Payment processors publish a fee of 15.00 dollars for every dispute received, and that fee is not returned when you lose. One mis-scaled charge produces a refund, a dispute fee and a support thread.

Why not just ask ChatGPT or another AI chat?

A general AI chat answers from training data with a cutoff date, cannot read your repository and names no rule version. Currency Minor Unit Lint checks the file you open against 24 rules from a rule set dated 2026-09-20, and points at the exact line. For a filing, an audit or a client you need that dated result on your own files.

Ask about this tool

One question, answered by the person who built it. Your email only if you want the answer sent.