{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "amount-in-words",
  "title": "Amount in Words",
  "description": "Names every digit group (2 lakh · 50 thousand), spells the amount cheque-style in lakh/crore or million with paise or cents, can show the other number system alongside, and checks typed words against the figure.",
  "dependencies": [
    "lucide-react"
  ],
  "files": [
    {
      "path": "registry/default/amount-in-words/amount-in-words.tsx",
      "content": "\"use client\"\r\n\r\n// Bollard UI — amount-in-words · MIT licence · https://bollard-ui.vercel.app/components/amount-in-words\r\n\r\nimport * as React from \"react\"\r\nimport { Check, CircleAlert, Copy, TriangleAlert } from \"lucide-react\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\nimport { amountToWords, integerToWords, parseAmountWords, type NumberSystem } from \"./words\"\r\n\r\nexport { amountToWords, integerToWords, parseAmountWords, CURRENCY_WORDS, type NumberSystem } from \"./words\"\r\n\r\n/** Place value of each digit group, right to left. Indian groups past crore are hundreds of crores. */\r\nconst GROUP_NAMES: Record<NumberSystem, string[]> = {\r\n  indian: [\"\", \"thousand\", \"lakh\", \"crore\", \"hundred crore\", \"ten thousand crore\", \"ten lakh crore\"],\r\n  international: [\"\", \"thousand\", \"million\", \"billion\", \"trillion\"],\r\n}\r\n\r\n/** \"10× more\", \"100× less\", or just \"more\"/\"less\" when the two aren't a power of ten apart. */\r\nfunction describeGap(words: number, figure: number) {\r\n  const direction = words > figure ? \"more\" : \"less\"\r\n  const power = Math.log10(Math.max(words / figure, figure / words))\r\n  return Math.abs(power - Math.round(power)) < 1e-9 ? `${10 ** Math.round(power)}× ${direction}` : direction\r\n}\r\n\r\nexport interface AmountInWordsProps extends Omit<React.ComponentProps<\"div\">, \"defaultValue\"> {\r\n  /** The amount in figures, in major units (250000.5 is ₹2,50,000.50). */\r\n  amount: number\r\n  /** ISO currency code. INR, USD, EUR, GBP, AED and SGD have cheque wording built in. */\r\n  currency?: string\r\n  /** Number system for grouping and words. Defaults to `indian` for INR, `international` otherwise. */\r\n  system?: NumberSystem\r\n  /** Shows the amount in the other system too (2.5 lakh = 250 thousand) for readers used to it. */\r\n  showOtherSystem?: boolean\r\n  /** Shows a field that checks words someone typed or wrote against the figure. */\r\n  verify?: boolean\r\n  /** Controlled words typed into the check field. */\r\n  value?: string\r\n  /** Initial words when uncontrolled. */\r\n  defaultValue?: string\r\n  /** Called with the words as they are typed or fixed. */\r\n  onValueChange?: (value: string) => void\r\n  /** Label of the check field. */\r\n  verifyLabel?: string\r\n  /** Shown when the words describe a different amount. Receives the amount the words describe. */\r\n  mismatchMessage?: (wordsAmount: string, gap: string) => string\r\n  /** Why a mismatch matters. Indian law (NI Act §18) pays the amount in words. */\r\n  mismatchNote?: string\r\n  /** Shown when the words match the figure. */\r\n  matchMessage?: string\r\n  /** Shown when the words don't end in \"Only\". */\r\n  onlyMessage?: string\r\n}\r\n\r\nconst fieldClass =\r\n  \"h-9 w-full min-w-0 rounded-md border bg-transparent px-3 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 md:text-sm dark:bg-input/30 aria-invalid:border-destructive data-warning:border-amber-500 dark:data-warning:border-amber-400\"\r\nconst fixClass =\r\n  \"inline-flex h-6 max-w-full items-center gap-1 rounded-md border px-2 text-left font-medium transition-colors outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50\"\r\n\r\n/**\r\n * Shows an amount the way it goes on a cheque or transfer: every digit group named\r\n * (2 lakh · 50 thousand), the words in cheque style, and the other number system\r\n * alongside, so ₹2,50,000 can't be read as ₹25,00,000. It also checks words someone\r\n * wrote against the figure, because on a cheque the words are what the bank pays.\r\n */\r\nexport function AmountInWords({\r\n  amount,\r\n  currency = \"INR\",\r\n  system = currency === \"INR\" ? \"indian\" : \"international\",\r\n  showOtherSystem = true,\r\n  verify = true,\r\n  value,\r\n  defaultValue = \"\",\r\n  onValueChange,\r\n  verifyLabel = \"Amount in words, as written\",\r\n  mismatchMessage = (words, gap) => `These words say ${words}, ${gap} than the figure.`,\r\n  mismatchNote = \"If they differ, the amount in words is the one paid.\",\r\n  matchMessage = \"Words match the figure.\",\r\n  onlyMessage = \"End with “Only” so nothing can be added after it.\",\r\n  className,\r\n  ...props\r\n}: AmountInWordsProps) {\r\n  const [inner, setInner] = React.useState(defaultValue)\r\n  const [copied, setCopied] = React.useState(false)\r\n  const id = React.useId()\r\n  const typed = value ?? inner\r\n  const minorUnits = Math.round(Math.abs(amount) * 100)\r\n  const words = amountToWords(minorUnits, currency, system)\r\n  const locale = system === \"indian\" ? \"en-IN\" : \"en-US\"\r\n  const money = (minor: number) =>\r\n    new Intl.NumberFormat(locale, { style: \"currency\", currency, currencyDisplay: \"narrowSymbol\" }).format(minor / 100)\r\n\r\n  const parts = new Intl.NumberFormat(locale, { style: \"currency\", currency, currencyDisplay: \"narrowSymbol\" }).formatToParts(minorUnits / 100)\r\n  const groups = parts.filter((p) => p.type === \"integer\").map((p) => p.value)\r\n  const names = GROUP_NAMES[system]\r\n  const symbol = parts.find((p) => p.type === \"currency\")?.value ?? \"\"\r\n  const fraction = parts.find((p) => p.type === \"fraction\")?.value\r\n  const other = integerToWords(Math.floor(minorUnits / 100), system === \"indian\" ? \"international\" : \"indian\")\r\n\r\n  const update = (next: string) => {\r\n    if (value === undefined) setInner(next)\r\n    onValueChange?.(next)\r\n  }\r\n\r\n  const copy = async () => {\r\n    try {\r\n      await navigator.clipboard.writeText(words)\r\n      setCopied(true)\r\n      setTimeout(() => setCopied(false), 1500)\r\n    } catch {\r\n      setCopied(false)\r\n    }\r\n  }\r\n\r\n  const parsed = typed.trim() ? parseAmountWords(typed) : null\r\n  const unknown = parsed?.unknown[0]\r\n  const mismatch = parsed?.minorUnits != null && parsed.minorUnits !== minorUnits\r\n  const status = !parsed ? null : unknown ? \"unknown\" : mismatch ? \"mismatch\" : parsed.minorUnits == null ? null : parsed.endsWithOnly ? \"match\" : \"only\"\r\n\r\n  return (\r\n    <div data-slot=\"amount-in-words\" className={cn(\"grid w-full max-w-md gap-3\", className)} {...props}>\r\n      <div className=\"rounded-lg border bg-card p-3\">\r\n        <p className=\"flex flex-wrap items-start gap-x-1 font-mono text-2xl font-semibold tabular-nums\" aria-label={money(minorUnits)}>\r\n          <span className=\"-mr-1 leading-8\">{symbol}</span>\r\n          {groups.map((group, i) => (\r\n            <span key={i} className=\"inline-flex flex-col items-center\">\r\n              <span className=\"leading-8\">\r\n                {group}\r\n                {i < groups.length - 1 ? <span className=\"text-muted-foreground\">,</span> : fraction ? <span className=\"text-muted-foreground\">.{fraction}</span> : null}\r\n              </span>\r\n              <span aria-hidden className=\"font-sans text-[10px] font-medium tracking-wide text-muted-foreground uppercase\">\r\n                {names[groups.length - 1 - i] || \"\\u00a0\"}\r\n              </span>\r\n            </span>\r\n          ))}\r\n        </p>\r\n        <div className=\"mt-2 flex items-start gap-2\">\r\n          <p key={words} className=\"min-w-0 flex-1 text-sm font-medium motion-safe:animate-[cui-amount-in-words-in_250ms_ease-out]\">\r\n            {words}\r\n          </p>\r\n          <button\r\n            type=\"button\"\r\n            onClick={copy}\r\n            aria-label={copied ? \"Copied\" : \"Copy words\"}\r\n            className=\"grid size-8 shrink-0 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50\"\r\n          >\r\n            {copied ? <Check aria-hidden className=\"size-4 text-emerald-600 dark:text-emerald-400\" /> : <Copy aria-hidden className=\"size-4\" />}\r\n          </button>\r\n        </div>\r\n        {showOtherSystem ? (\r\n          <p className=\"mt-1 text-xs text-muted-foreground\">\r\n            {system === \"indian\" ? \"International\" : \"Indian\"}: {other}\r\n          </p>\r\n        ) : null}\r\n      </div>\r\n\r\n      {verify ? (\r\n        <div className=\"grid gap-1.5\">\r\n          <label htmlFor={id} className=\"w-fit text-sm font-medium\">\r\n            {verifyLabel}\r\n          </label>\r\n          <input\r\n            id={id}\r\n            value={typed}\r\n            onChange={(e) => update(e.target.value)}\r\n            spellCheck={false}\r\n            autoComplete=\"off\"\r\n            aria-invalid={status === \"mismatch\" || undefined}\r\n            aria-describedby={`${id}-status`}\r\n            data-warning={status === \"unknown\" || status === \"only\" ? \"\" : undefined}\r\n            className={fieldClass}\r\n          />\r\n          <div id={`${id}-status`} aria-live=\"polite\" className=\"min-h-6 text-xs\">\r\n            {status === \"mismatch\" && parsed?.minorUnits != null ? (\r\n              <div role=\"alert\" className=\"flex gap-1.5 text-destructive motion-safe:animate-[cui-amount-in-words-in_250ms_ease-out]\">\r\n                <CircleAlert aria-hidden className=\"mt-1 size-3.5 shrink-0\" />\r\n                <div className=\"grid min-w-0 gap-1.5\">\r\n                  <p className=\"py-0.5\">\r\n                    <span className=\"font-medium\">{mismatchMessage(money(parsed.minorUnits), describeGap(parsed.minorUnits, minorUnits))}</span> {mismatchNote}\r\n                  </p>\r\n                  <button type=\"button\" onClick={() => update(words)} className={cn(fixClass, \"h-auto min-h-6 border-red-500/40 py-0.5 hover:bg-red-500/10\")}>\r\n                    Use “{words}”\r\n                  </button>\r\n                </div>\r\n              </div>\r\n            ) : status === \"unknown\" && unknown ? (\r\n              <p className=\"flex flex-wrap items-center gap-1.5 text-amber-700 dark:text-amber-400\">\r\n                <TriangleAlert aria-hidden className=\"size-3.5 shrink-0\" />\r\n                <span className=\"py-1\">Can’t read “{unknown.word}”.</span>\r\n                {unknown.suggestion ? (\r\n                  <button\r\n                    type=\"button\"\r\n                    onClick={() => update(typed.replace(new RegExp(`\\\\b${unknown.word}\\\\b`, \"i\"), unknown.suggestion as string))}\r\n                    className={cn(fixClass, \"border-amber-500/40 text-amber-900 hover:bg-amber-500/10 dark:text-amber-200\")}\r\n                  >\r\n                    Use “{unknown.suggestion}”\r\n                  </button>\r\n                ) : null}\r\n              </p>\r\n            ) : status === \"only\" ? (\r\n              <p className=\"flex flex-wrap items-center gap-1.5 text-amber-700 dark:text-amber-400\">\r\n                <TriangleAlert aria-hidden className=\"size-3.5 shrink-0\" />\r\n                <span className=\"py-1\">{onlyMessage}</span>\r\n                <button\r\n                  type=\"button\"\r\n                  onClick={() => update(`${typed.trim().replace(/[.\\s]+$/, \"\")} Only`)}\r\n                  className={cn(fixClass, \"border-amber-500/40 text-amber-900 hover:bg-amber-500/10 dark:text-amber-200\")}\r\n                >\r\n                  Add “Only”\r\n                </button>\r\n              </p>\r\n            ) : status === \"match\" ? (\r\n              <p className=\"flex items-center gap-1.5 py-1 text-emerald-700 dark:text-emerald-400\">\r\n                <Check aria-hidden className=\"size-3.5\" />\r\n                {matchMessage}\r\n              </p>\r\n            ) : null}\r\n          </div>\r\n        </div>\r\n      ) : null}\r\n      <style>{`@keyframes cui-amount-in-words-in{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}`}</style>\r\n    </div>\r\n  )\r\n}\r\n",
      "type": "registry:ui",
      "target": "@ui/amount-in-words.tsx"
    },
    {
      "path": "registry/default/amount-in-words/words.ts",
      "content": "// Bollard UI — amount-in-words · MIT licence · https://bollard-ui.vercel.app/components/amount-in-words\r\n\r\n/** Number systems: lakh/crore (`indian`) or thousand/million/billion (`international`). */\r\nexport type NumberSystem = \"indian\" | \"international\"\r\n\r\n/** How a currency is written on a cheque. `prefix` puts the unit first (\"Rupees Ten Only\"). */\r\nexport interface CurrencyWords {\r\n  major: string\r\n  majorOne: string\r\n  minor: string\r\n  minorOne: string\r\n  prefix?: boolean\r\n}\r\n\r\nexport const CURRENCY_WORDS: Record<string, CurrencyWords> = {\r\n  INR: { major: \"Rupees\", majorOne: \"Rupee\", minor: \"Paise\", minorOne: \"Paisa\", prefix: true },\r\n  USD: { major: \"Dollars\", majorOne: \"Dollar\", minor: \"Cents\", minorOne: \"Cent\" },\r\n  EUR: { major: \"Euros\", majorOne: \"Euro\", minor: \"Cents\", minorOne: \"Cent\" },\r\n  GBP: { major: \"Pounds\", majorOne: \"Pound\", minor: \"Pence\", minorOne: \"Penny\" },\r\n  AED: { major: \"Dirhams\", majorOne: \"Dirham\", minor: \"Fils\", minorOne: \"Fils\" },\r\n  SGD: { major: \"Dollars\", majorOne: \"Dollar\", minor: \"Cents\", minorOne: \"Cent\" },\r\n}\r\n\r\nconst ONES = [\"zero\", \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"ten\", \"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"]\r\nconst TENS = [\"\", \"\", \"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\", \"seventy\", \"eighty\", \"ninety\"]\r\nconst SCALES: Record<string, number> = {\r\n  hundred: 100, thousand: 1e3, lakh: 1e5, lakhs: 1e5, lac: 1e5, lacs: 1e5, crore: 1e7, crores: 1e7, cr: 1e7,\r\n  million: 1e6, millions: 1e6, billion: 1e9, billions: 1e9, trillion: 1e12,\r\n}\r\nconst SMALL: Record<string, number> = Object.fromEntries([\r\n  ...ONES.map((w, i) => [w, i] as const),\r\n  ...TENS.slice(2).map((w, i) => [w, (i + 2) * 10] as const),\r\n  [\"fourty\", 40], [\"ninty\", 90],\r\n])\r\nconst MAJOR_WORDS = new Set([\"rupees\", \"rupee\", \"rs\", \"inr\", \"dollars\", \"dollar\", \"usd\", \"euros\", \"euro\", \"pounds\", \"pound\", \"dirhams\", \"dirham\", \"aed\", \"sgd\"])\r\nconst MINOR_WORDS = new Set([\"paise\", \"paisa\", \"cents\", \"cent\", \"pence\", \"penny\", \"fils\"])\r\nconst FILLER = new Set([\"and\", \"only\", \"of\", \"a\", \"exactly\"])\r\n\r\nfunction below1000(n: number) {\r\n  const hundreds = Math.floor(n / 100)\r\n  const rest = n % 100\r\n  const tail = rest === 0 ? \"\" : rest < 20 ? ONES[rest] : TENS[Math.floor(rest / 10)] + (rest % 10 ? `-${ONES[rest % 10]}` : \"\")\r\n  return [hundreds ? `${ONES[hundreds]} hundred` : \"\", tail].filter(Boolean).join(\" \")\r\n}\r\n\r\n/** Spells a whole number: 250000 → \"two lakh fifty thousand\" (indian) or \"two hundred fifty thousand\". */\r\nexport function integerToWords(n: number, system: NumberSystem): string {\r\n  n = Math.floor(Math.abs(n))\r\n  if (n === 0) return \"zero\"\r\n  const parts: string[] = []\r\n  if (system === \"indian\") {\r\n    const crore = Math.floor(n / 1e7)\r\n    if (crore) parts.push(`${integerToWords(crore, \"indian\")} crore`)\r\n    for (const [size, name] of [[1e5, \"lakh\"], [1e3, \"thousand\"]] as const) {\r\n      const chunk = Math.floor(n / size) % 100\r\n      if (chunk) parts.push(`${below1000(chunk)} ${name}`)\r\n    }\r\n  } else {\r\n    const names = [\"\", \"thousand\", \"million\", \"billion\", \"trillion\"]\r\n    for (let i = names.length - 1; i >= 1; i--) {\r\n      const chunk = Math.floor(n / 1000 ** i) % 1000\r\n      if (chunk) parts.push(`${below1000(chunk)} ${names[i]}`)\r\n    }\r\n  }\r\n  if (n % 1000) parts.push(below1000(n % 1000))\r\n  return parts.join(\" \")\r\n}\r\n\r\nconst titleCase = (text: string) => text.replace(/(^|[\\s-])([a-z])/g, (_, gap: string, ch: string) => gap + ch.toUpperCase())\r\n\r\n/**\r\n * Cheque wording for an amount in minor units (paise, cents):\r\n * 25000050 → \"Rupees Two Lakh Fifty Thousand and Fifty Paise Only\".\r\n */\r\nexport function amountToWords(minorUnits: number, currency: string, system: NumberSystem): string {\r\n  const units = CURRENCY_WORDS[currency] ?? { major: currency, majorOne: currency, minor: \"/100\", minorOne: \"/100\" }\r\n  const major = Math.floor(minorUnits / 100)\r\n  const minor = minorUnits % 100\r\n  const majorText = titleCase(integerToWords(major, system))\r\n  const majorUnit = major === 1 ? units.majorOne : units.major\r\n  const head = units.prefix ? `${majorUnit} ${majorText}` : `${majorText} ${majorUnit}`\r\n  const tail = minor ? ` and ${titleCase(integerToWords(minor, \"international\"))} ${minor === 1 ? units.minorOne : units.minor}` : \"\"\r\n  return `${head}${tail} Only`\r\n}\r\n\r\n/** Optimal string alignment distance, for \"fivty\" → \"fifty\" and \"lack\" → \"lakh\". */\r\nfunction distance(a: string, b: string) {\r\n  const d = Array.from({ length: a.length + 1 }, (_, i) => [i, ...Array<number>(b.length).fill(0)])\r\n  for (let j = 1; j <= b.length; j++) d[0][j] = j\r\n  for (let i = 1; i <= a.length; i++) {\r\n    for (let j = 1; j <= b.length; j++) {\r\n      d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1))\r\n      if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1)\r\n    }\r\n  }\r\n  return d[a.length][b.length]\r\n}\r\n\r\nexport interface ParsedWords {\r\n  /** The amount the words describe, in minor units, or null when any word could not be read. */\r\n  minorUnits: number | null\r\n  /** Words that are not numbers, each with the number word it most likely meant. */\r\n  unknown: { word: string; suggestion?: string }[]\r\n  /** Whether the text ends with \"only\", which stops anything being added after it. */\r\n  endsWithOnly: boolean\r\n}\r\n\r\n/**\r\n * Reads an amount written in words, in either system and in mixed forms:\r\n * \"Rupees Two Lakh Fifty Thousand Only\", \"2.5 lakh\", \"twenty five lacs\",\r\n * \"two hundred and fifty thousand dollars and 50/100\", \"one crore twenty lakh\".\r\n */\r\nexport function parseAmountWords(text: string): ParsedWords {\r\n  const tokens = text.toLowerCase().replace(/\\/-/g, \" only \").replace(/(\\d),(?=\\d)/g, \"$1\").replace(/[-–,]/g, \" \").replace(/[.](?!\\d)/g, \" \").split(/\\s+/).filter(Boolean)\r\n  const known = [...Object.keys(SMALL), ...Object.keys(SCALES), ...MAJOR_WORDS, ...MINOR_WORDS, ...FILLER]\r\n  const unknown: ParsedWords[\"unknown\"] = []\r\n  let total = 0\r\n  let current = 0\r\n  let largest = 1\r\n  let minor = 0\r\n  let mark = 0 // value of `current` at the last \"and\" or currency word, where paise/cents may start\r\n  let seen = false\r\n\r\n  for (const token of tokens) {\r\n    const fraction = token.match(/^(\\d{1,2})\\/100$/)\r\n    if (fraction) {\r\n      minor = Number(fraction[1])\r\n      seen = true\r\n    } else if (/^\\d+(\\.\\d+)?$/.test(token)) {\r\n      current += Number(token)\r\n      seen = true\r\n    } else if (token in SMALL) {\r\n      current += SMALL[token]\r\n      seen = true\r\n    } else if (token === \"hundred\") {\r\n      current = (current || 1) * 100\r\n      seen = true\r\n    } else if (token in SCALES) {\r\n      const scale = SCALES[token]\r\n      // \"five thousand crore\" multiplies everything before it; \"two lakh fifty thousand\" adds.\r\n      if (scale > largest) total = (total + current || 1) * scale\r\n      else total += (current || 1) * scale\r\n      largest = Math.max(largest, scale)\r\n      current = mark = 0\r\n      seen = true\r\n    } else if (MINOR_WORDS.has(token)) {\r\n      minor = current - mark\r\n      current = mark\r\n    } else if (token === \"and\" || MAJOR_WORDS.has(token)) {\r\n      mark = current\r\n    } else if (!MAJOR_WORDS.has(token) && !FILLER.has(token)) {\r\n      const best = known.reduce<{ word?: string; score: number }>(\r\n        (acc, word) => {\r\n          const score = distance(token, word)\r\n          return score < acc.score ? { word, score } : acc\r\n        },\r\n        { score: token.length > 4 ? 3 : 2 },\r\n      )\r\n      unknown.push({ word: token, suggestion: best.word })\r\n    }\r\n  }\r\n\r\n  const major = total + current\r\n  return {\r\n    minorUnits: seen && !unknown.length && minor < 100 ? Math.round(major * 100) + minor : null,\r\n    unknown,\r\n    endsWithOnly: tokens[tokens.length - 1] === \"only\",\r\n  }\r\n}\r\n",
      "type": "registry:ui",
      "target": "@components/amount-in-words/words.ts"
    }
  ],
  "meta": {
    "stops": "Extra zero on a transfer",
    "mistakes": [
      "2 lakh vs 20 lakh",
      "amount in words",
      "cheque amount words",
      "rupees in words",
      "lakh crore confusion"
    ],
    "aliases": [
      "amount in words",
      "cheque",
      "lakh",
      "crore",
      "rupees",
      "number to words",
      "neft",
      "invoice"
    ],
    "flows": [
      "india",
      "checkout"
    ],
    "fields": [
      "amount"
    ],
    "summary": "Spells an amount in words and names each digit group, so ₹2,50,000 isn't written or read as ₹25,00,000.",
    "catches": [
      "An extra or missing zero, by naming each digit group",
      "Typed words that do not match the figure, with a one-tap correction",
      "Confusion between lakh/crore and million/billion, via the other system shown alongside",
      "Mismatches that are a power of ten apart (\"10× more\")"
    ],
    "limits": [
      "Words are English only, with cheque wording built in for INR, USD, EUR, GBP, AED and SGD",
      "Takes the amount as a JavaScript number in major units, so very large values lose precision",
      "Word matching is a text comparison; unusual spellings may be reported as a mismatch"
    ],
    "a11y": [
      "The grouped figure has an aria-label with the full amount; the visual group labels are aria-hidden",
      "Words input has a <label>, aria-invalid on mismatch and aria-describedby to its status",
      "Match status is aria-live=\"polite\"; a mismatch uses role=\"alert\"",
      "Copy button has an aria-label that changes to \"Copied\""
    ],
    "usage": "import { AmountInWords } from \"@/components/ui/amount-in-words\"",
    "runtimeDependencies": [
      "lucide-react"
    ],
    "zeroRuntimeDependencies": false
  },
  "docs": "https://bollard-ui.vercel.app/components/amount-in-words",
  "categories": [
    "Reading without mistakes"
  ],
  "type": "registry:ui"
}
