Parse locale-formatted money text (1.234,56, 1,00,000, accounting parentheses) without guessing

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/locale-number · Id locale-number

Parses up to 100 number or money strings such as "1.234,56", "1,00,000", "(1,234.50)", "¥1,000" or "CHF 1'234.50" into canonical decimal strings, for an agent reading amounts from documents, emails or tables. With a BCP 47 locale it applies that locale's CLDR separators (read from Intl.NumberFormat); without one it lists every valid reading and an ambiguous string such as "1,234" returns unknown with both (1234 and 1.234) instead of a guess. Understands leading and trailing minus, U+2212, accounting parentheses, non-ASCII digit systems and currency symbols or ISO codes (a symbol shared by several currencies, such as ¥ or $, is reported as ambiguous unless the caller names the currency). Does not convert currencies and does not round.

What you get

"1,234" is one thousand or one-point-two-three-four depending on the author; the wrong guess is a 1000x error. Ambiguity is returned, not resolved silently.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/locale-number. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/locale-number \
  -H 'content-type: application/json' \
  -d '{"items":[{"text":"1.234,56","locale":"de-DE"},{"text":"1,00,000"},{"text":"1,234"},{"text":"(1,234.50)","currency":"USD"}]}'

Input

FieldTypeRequiredDescription
itemsarray<object>; max 100 itemsyes

Example request body

{
  "items": [
    {
      "text": "1.234,56",
      "locale": "de-DE"
    },
    {
      "text": "1,00,000"
    },
    {
      "text": "1,234"
    },
    {
      "text": "(1,234.50)",
      "currency": "USD"
    }
  ]
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
itemsarray<object>no
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the money-math-kit package.

Machine-readable