{"_id":"to-numbers","_rev":"3-b9a0da8c5bc4a7b6df5ed0e24d12309c","name":"to-numbers","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.1":{"name":"to-numbers","version":"0.0.1","keywords":["to numbers","words to numbers","words-to-numbers","words to numbers currency","international words to numbers","international words to numbers currency","convert-words","i18n","converter","number","word","currency","parse"],"author":{"name":"Munjal Dhamecha"},"license":"MIT","_id":"to-numbers@0.0.1","maintainers":[{"name":"mastermunj","email":"mastermunj@gmail.com"}],"homepage":"https://github.com/mastermunj/to-numbers#readme","bugs":{"url":"https://github.com/mastermunj/to-numbers/issues"},"dist":{"shasum":"662465b7754fe2b309ed6ee90b55356692c231f9","tarball":"https://registry.npmjs.org/to-numbers/-/to-numbers-0.0.1.tgz","fileCount":95,"integrity":"sha512-bIdu9blFAvZqfaf/NmX1Fi+BD7TY9V2Qu6E/jEoYpUp6NbNdsk441c14hvzivCbvt70mnQpLAWWzCQ4zU8c7CQ==","signatures":[{"sig":"MEYCIQCvzPPW6j7RyZR4rp/V/+9ds95zfWOQtUhFz3nUxxyslAIhALDIeQ+Hsf7RgqaSoprKJDgwLL7j4DfAtm27cmMN3sIi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246580},"main":"dist/ToNumbers.js","types":"./dist/ToNumbers.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"engines":{"node":">=12.0.0"},"gitHead":"40881cb511753833f9fd826e8acd88179f2f9f0d","scripts":{"lint":"eslint --max-warnings=0 .","test":"vitest","build":"npm run clean && tsc --noEmitOnError","clean":"rimraf dist coverage","commit":"git-cz","prepare":"husky","release":"standard-version","lint:fix":"npm run lint -- --fix","test:watch":"npm run test -- --watch","build:watch":"npm run build -- --watch","release:mock":"npm run release -- --dry-run"},"_npmUser":{"name":"mastermunj","email":"mastermunj@gmail.com"},"repository":{"url":"git+https://github.com/mastermunj/to-numbers.git","type":"git"},"_npmVersion":"10.9.2","description":"Converts words (including decimal points) into numbers & currency. The reverse of to-words.","directories":{},"_nodeVersion":"23.9.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^9.39.2","lodash":"^4.17.21","rimraf":"^6.1.2","vitest":"^4.0.16","prettier":"^3.7.4","typescript":"^5.9.3","@types/node":"^25.0.3","lint-staged":"^16.2.7","@types/lodash":"^4.17.21","@commitlint/cli":"^20.3.0","standard-version":"^9.5.0","sort-package-json":"^3.6.0","source-map-support":"^0.5.21","@vitest/coverage-v8":"^4.0.16","eslint-plugin-import":"^2.32.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","@types/source-map-support":"^0.5.10","@typescript-eslint/parser":"^8.52.0","cz-conventional-changelog":"^3.3.0","@commitlint/config-conventional":"^20.3.0","@typescript-eslint/eslint-plugin":"^8.52.0"},"_npmOperationalInternal":{"tmp":"tmp/to-numbers_0.0.1_1769534671406_0.4045616585781442","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"to-numbers","version":"1.0.0","keywords":["to numbers","words to numbers","words-to-numbers","words to numbers currency","international words to numbers","international words to numbers currency","convert-words","i18n","converter","number","word","currency","parse"],"author":{"name":"Munjal Dhamecha"},"license":"MIT","_id":"to-numbers@1.0.0","maintainers":[{"name":"mastermunj","email":"mastermunj@gmail.com"}],"homepage":"https://github.com/mastermunj/to-numbers#readme","bugs":{"url":"https://github.com/mastermunj/to-numbers/issues"},"dist":{"shasum":"36d279727fed0d7beb50832d266f7087e96d5956","tarball":"https://registry.npmjs.org/to-numbers/-/to-numbers-1.0.0.tgz","fileCount":400,"integrity":"sha512-BeeClSRzjICb7pNfb6mUBVbCICXzYmjosPcQP5NgUqVt0B3exIkei8eHu0bXG3/mpSIITXpggURVzDkuMnqPKA==","signatures":[{"sig":"MEUCIQCqYbHq3J5UbHi4DlYTNrWbTYyiCvj2y/fPpEKBh5I7ggIgUrjN5NZgJGRT6lkFjJR1HFaDMduAUF1XoKuXqnVsokg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4558679},"main":"dist/cjs/ToNumbers.js","type":"module","types":"dist/types/ToNumbers.d.ts","unpkg":"dist/umd/to-numbers.min.js","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"module":"dist/esm/ToNumbers.js","browser":"dist/umd/to-numbers.min.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/types/ToNumbers.d.ts","import":"./dist/esm/ToNumbers.js","require":"./dist/cjs/ToNumbers.js"},"./*":{"types":"./dist/types/locales/*.d.ts","import":"./dist/esm/locales/*.js","require":"./dist/cjs/locales/*.js"},"./core":{"types":"./dist/types/ToNumbersCore.d.ts","import":"./dist/esm/ToNumbersCore.js","require":"./dist/cjs/ToNumbersCore.js"},"./types":{"types":"./dist/types/types.d.ts","import":"./dist/esm/types.js","require":"./dist/cjs/types.js"}},"gitHead":"599ec102beb82282eee3b15e2ca6b07fe43004dd","scripts":{"lint":"eslint --max-warnings=0 .","test":"vitest","bench":"vitest bench","build":"npm run clean && npm run build:types && npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:pkgjson","clean":"rimraf dist coverage","commit":"git-cz","prepare":"husky","release":"commit-and-tag-version","lint:fix":"npm run lint -- --fix","build:cjs":"tsc -p tsconfig.cjs.json","build:esm":"tsc -p tsconfig.esm.json","build:umd":"node --experimental-strip-types scripts/build-umd.ts","test:watch":"npm run test -- --watch","build:types":"tsc -p tsconfig.json","build:watch":"npm run build -- --watch","release:mock":"npm run release -- --dry-run","build:pkgjson":"echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json"},"_npmUser":{"name":"mastermunj","email":"mastermunj@gmail.com"},"jsdelivr":"dist/umd/to-numbers.min.js","repository":{"url":"git+https://github.com/mastermunj/to-numbers.git","type":"git"},"_npmVersion":"11.6.2","description":"Converts words (including decimal points) into numbers & currency. The reverse of to-words.","directories":{},"_nodeVersion":"24.13.0","typesVersions":{"*":{"*":["dist/types/locales/*"],"core":["dist/types/ToNumbersCore"],"types":["dist/types/types"]}},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^9.39.2","lodash":"^4.17.23","rimraf":"^6.1.2","vitest":"^4.0.18","esbuild":"^0.27.2","prettier":"^3.8.1","to-words":"^5.0.0","typescript":"^5.9.3","@types/node":"^25.2.0","lint-staged":"^16.2.7","@types/lodash":"^4.17.23","@commitlint/cli":"^20.4.1","sort-package-json":"^3.6.1","source-map-support":"^0.5.21","@vitest/coverage-v8":"^4.0.18","eslint-plugin-import":"^2.32.0","commit-and-tag-version":"^12.6.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","@types/source-map-support":"^0.5.10","@typescript-eslint/parser":"^8.54.0","cz-conventional-changelog":"^3.3.0","@commitlint/config-conventional":"^20.4.1","@typescript-eslint/eslint-plugin":"^8.54.0"},"_npmOperationalInternal":{"tmp":"tmp/to-numbers_1.0.0_1770106964940_0.4377861572919304","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"to-numbers","version":"1.1.0","description":"Converts words (including decimal points) into numbers & currency. The reverse of to-words.","keywords":["convert-words","converter","currency","i18n","international words to numbers","international words to numbers currency","number","parse","to numbers","word","words to numbers","words to numbers currency","words-to-numbers"],"homepage":"https://github.com/mastermunj/to-numbers#readme","bugs":{"url":"https://github.com/mastermunj/to-numbers/issues"},"license":"MIT","author":{"name":"Munjal Dhamecha"},"repository":{"type":"git","url":"git+https://github.com/mastermunj/to-numbers.git"},"funding":{"type":"github","url":"https://github.com/sponsors/mastermunj"},"bin":{"to-numbers":"dist/cjs/cli.js"},"type":"module","main":"dist/cjs/ToNumbers.js","module":"dist/esm/ToNumbers.js","browser":"dist/umd/to-numbers.min.js","types":"dist/types/ToNumbers.d.ts","typesVersions":{"*":{"*":["dist/types/locales/*"],"types":["dist/types/types"],"core":["dist/types/ToNumbersCore"]}},"unpkg":"dist/umd/to-numbers.min.js","jsdelivr":"dist/umd/to-numbers.min.js","exports":{".":{"types":"./dist/types/ToNumbers.d.ts","import":"./dist/esm/ToNumbers.js","require":"./dist/cjs/ToNumbers.js"},"./*":{"types":"./dist/types/locales/*.d.ts","import":"./dist/esm/locales/*.js","require":"./dist/cjs/locales/*.js"},"./types":{"types":"./dist/types/types.d.ts","import":"./dist/esm/types.js","require":"./dist/cjs/types.js"},"./core":{"types":"./dist/types/ToNumbersCore.d.ts","import":"./dist/esm/ToNumbersCore.js","require":"./dist/cjs/ToNumbersCore.js"}},"scripts":{"bench":"vitest bench","build":"npm run clean && npm run build:types && npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:pkgjson && npm run build:cli","build:cjs":"tsc -p tsconfig.cjs.json","build:cli":"chmod +x dist/cjs/cli.js","build:esm":"tsc -p tsconfig.esm.json","build:pkgjson":"echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json","build:types":"tsc -p tsconfig.json","build:umd":"node --experimental-strip-types scripts/build-umd.ts","build:watch":"npm run build -- --watch","clean":"rimraf dist coverage","commit":"git-cz","format":"oxfmt --check --config ./node_modules/@mastermunj/oxc-config/.oxfmtrc.json .","format:fix":"oxfmt --write --config ./node_modules/@mastermunj/oxc-config/.oxfmtrc.json .","lint":"oxlint --type-aware .","lint:fix":"npm run lint -- --fix","prepare":"husky","test":"vitest","test:watch":"npm run test -- --watch"},"devDependencies":{"@commitlint/cli":"^20.4.1","@commitlint/config-conventional":"^20.4.1","@mastermunj/oxc-config":"^0.0.4","@types/lodash":"^4.17.23","@types/node":"^25.2.0","@types/source-map-support":"^0.5.10","@vitest/coverage-v8":"^4.0.18","cz-conventional-changelog":"^3.3.0","esbuild":"^0.28.0","husky":"^9.1.7","lint-staged":"^16.2.7","lodash":"^4.17.23","oxfmt":"^0.44.0","oxlint":"^1.57.0","oxlint-tsgolint":"^0.20.0","rimraf":"^6.1.2","source-map-support":"^0.5.21","typescript":"^5.9.3","vitest":"^4.0.18"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"engines":{"node":">=20.0.0"},"gitHead":"8fff674f32a9fa4e16ffef2e87e2af23fe86066d","_id":"to-numbers@1.1.0","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-XoPzXvl7X0fmQObf8OyBqJf9sEfR73/tOqXlxP0r6K20fZBv3VOppDVKtOPr94acK4ayTDAZhyfkeBxQdg4QVw==","shasum":"e84f8acadae9e48158b1bec740bfd00c6a27db84","tarball":"https://registry.npmjs.org/to-numbers/-/to-numbers-1.1.0.tgz","fileCount":523,"unpackedSize":7101727,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/to-numbers@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCpXaXzCGcqCNK1mcin8UEUcWv0am48NW2sPdUiHpgS5QIge90caU2qYlC3dWtf/ad3pPGp6uocduC+i9uF5YBNP+k="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d07a1f55-6508-4891-afef-d3ccf1cb68c1"}},"directories":{},"maintainers":[{"name":"mastermunj","email":"mastermunj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/to-numbers_1.1.0_1776769322276_0.2709847830298735"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-27T17:24:31.406Z","modified":"2026-04-21T11:02:02.754Z","0.0.1":"2026-01-27T17:24:31.551Z","1.0.0":"2026-02-03T08:22:45.162Z","1.1.0":"2026-04-21T11:02:02.475Z"},"bugs":{"url":"https://github.com/mastermunj/to-numbers/issues"},"author":{"name":"Munjal Dhamecha"},"license":"MIT","homepage":"https://github.com/mastermunj/to-numbers#readme","keywords":["convert-words","converter","currency","i18n","international words to numbers","international words to numbers currency","number","parse","to numbers","word","words to numbers","words to numbers currency","words-to-numbers"],"repository":{"type":"git","url":"git+https://github.com/mastermunj/to-numbers.git"},"description":"Converts words (including decimal points) into numbers & currency. The reverse of to-words.","maintainers":[{"name":"mastermunj","email":"mastermunj@gmail.com"}],"readme":"# to-numbers\n\n[![npm version](https://img.shields.io/npm/v/to-numbers.svg)](https://www.npmjs.com/package/to-numbers)\n[![npm downloads](https://img.shields.io/npm/dm/to-numbers.svg)](https://www.npmjs.com/package/to-numbers)\n[![build](https://img.shields.io/github/actions/workflow/status/mastermunj/to-numbers/ci.yml?branch=main&label=build)](https://github.com/mastermunj/to-numbers/actions)\n[![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://github.com/mastermunj/to-numbers)\n[![minzipped size](https://img.shields.io/bundlephobia/minzip/to-numbers?label=minzipped)](https://bundlephobia.com/package/to-numbers)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue)](https://www.typescriptlang.org/)\n[![node](https://img.shields.io/node/v/to-numbers)](https://www.npmjs.com/package/to-numbers)\n[![license](https://img.shields.io/npm/l/to-numbers)](https://github.com/mastermunj/to-numbers/blob/main/LICENSE)\n\nConvert words to numbers with comprehensive locale, currency, and decimal support. The reverse of the [`to-words`](https://www.npmjs.com/package/to-words) package. Ideal for parsing written amounts in invoicing, voice input, e-commerce, and financial applications.\n\n## 📑 Table of Contents\n\n- [Use Cases](#-use-cases)\n- [Features](#-features)\n- [Performance](#-performance)\n- [Quick Start](#-quick-start)\n- [Installation](#-installation)\n- [Usage](#-usage)\n- [Framework Integration](#%EF%B8%8F-framework-integration)\n- [Numbering Systems](#-numbering-systems)\n- [API Reference](#%EF%B8%8F-api-reference)\n- [Bundle Sizes](#-bundle-sizes)\n- [Browser Compatibility](#-browser-compatibility)\n- [Supported Locales](#%EF%B8%8F-supported-locales)\n- [Error Handling](#%EF%B8%8F-error-handling)\n- [Support](#-support)\n- [Contributing](#-contributing)\n- [FAQ](#-faq)\n- [Changelog](#-changelog)\n- [License](#-license)\n\n## 💼 Use Cases\n\n- **Financial Applications** — Parse amount-in-words from invoices, cheques, and financial documents\n- **Voice/Speech Input** — Convert spoken numbers from speech-to-text to numeric values\n- **Data Processing** — Extract numeric data from textual documents and forms\n- **OCR Post-Processing** — Parse numbers recognized from scanned documents\n- **Chatbots & NLP** — Understand numeric inputs in natural language\n- **Accessibility** — Support users who input numbers as words\n- **Localization** — Parse numbers in 124 languages and regions\n\n## ✨ Features\n\n- **124 Locales** — The most comprehensive locale coverage available\n- **High Performance** — Optimized parsing paths with benchmark coverage for real-world inputs\n- **Reverse of to-words** — Perfectly complements the to-words package\n- **Multiple Numbering Systems** — Short scale, Long scale, Indian, East Asian, Burmese, Khmer, and scale-first ordering\n- **Currency Parsing** — Parse locale-specific currency with fractional units\n- **Ordinal Numbers** — Parse ordinals across all 124 locales\n- **Structured Parse Metadata** — `parse()` returns flags such as `isCurrency`, `isNegative`, and `isOrdinal`\n- **Decimal Numbers** — Handle \"Point\" notation and fractional units\n- **Case Insensitive** — Works with any case combination\n- **Tree-Shakeable** — Import only the locales you need\n- **TypeScript Native** — Full type definitions included\n- **Multiple Formats** — ESM, CommonJS, and UMD browser bundles\n- **Zero Dependencies** — Lightweight and self-contained\n\n## ⚡ Performance\n\nBenchmarked on Apple M2, Node.js v24.13.0, using `vitest bench`. Throughput varies by locale and input shape, so the table below uses the current sampled-locale ranges from `bench/to-numbers.bench.ts` rather than a single headline number.\n\n| Benchmark Case          | Example                                             | Throughput Range       |\n| ----------------------- | --------------------------------------------------- | ---------------------- |\n| Small Integer           | \"Forty Two\"                                         | ~1.1M to ~3.1M ops/sec |\n| Medium Integer          | \"Twelve Thousand Three Hundred Forty Five\"          | ~117K to ~1.0M ops/sec |\n| Large Integer           | \"Nine Trillion Eight Hundred Seventy Six...\"        | ~155K to ~567K ops/sec |\n| Currency Parsing        | \"One Thousand Two Hundred Rupees And Fifty Paise\"   | ~336K to ~851K ops/sec |\n| Ordinal Parsing         | \"Twenty First\"                                      | ~1.5M to ~4.9M ops/sec |\n| `parse()` with Metadata | `parse('Twelve Thousand Three Hundred Forty Five')` | ~508K to ~1.0M ops/sec |\n| Fraction-Style Decimal  | \"Forty Five Hundredths\"                             | ~1.3M ops/sec          |\n| Gendered Input          | \"Veintiuna\"                                         | ~3.1M ops/sec          |\n| Formal Chinese          | \"玖拾\"                                              | ~1.8M ops/sec          |\n\nRun `npm run bench` on your target hardware for current throughput.\n\n## 🚀 Quick Start\n\n```js\nimport { ToNumbers } from 'to-numbers';\n\nconst toNumbers = new ToNumbers();\ntoNumbers.convert('Twelve Thousand Three Hundred Forty Five');\n// 12345\n```\n\n## 📦 Installation\n\n> **Runtime requirement:** Node.js `>= 20` for Node.js and CLI usage.\n\n### npm / yarn / pnpm\n\n```bash\nnpm install to-numbers\n# or\nyarn add to-numbers\n# or\npnpm add to-numbers\n```\n\n### CDN (Browser)\n\n```html\n<!-- Full bundle with all locales -->\n<script src=\"https://cdn.jsdelivr.net/npm/to-numbers/dist/umd/to-numbers.min.js\"></script>\n\n<!-- Single locale bundle (smaller, recommended) -->\n<script src=\"https://cdn.jsdelivr.net/npm/to-numbers/dist/umd/en-US.min.js\"></script>\n```\n\n## 📖 Usage\n\n### Importing\n\n```js\n// ESM\nimport { ToNumbers, toNumbers } from 'to-numbers';\n\n// CommonJS\nconst { ToNumbers, toNumbers } = require('to-numbers');\n\n// Tree-shakeable per-locale import\nimport { ToNumbers as EnUsToNumbers, toNumbers as enUsToNumbers } from 'to-numbers/en-US';\n```\n\n### Basic Conversion\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'en-US' });\n\ntoNumbers.convert('One Hundred Twenty Three');\n// 123\n\ntoNumbers.convert('One Hundred Twenty Three Point Four Five');\n// 123.45\n\ntoNumbers.convert('Minus Fifty');\n// -50\n```\n\n### Case Insensitivity\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'en-US' });\n\ntoNumbers.convert('one hundred twenty three');\n// 123\n\ntoNumbers.convert('ONE HUNDRED TWENTY THREE');\n// 123\n\ntoNumbers.convert('One Hundred Twenty Three');\n// 123\n```\n\n### Ordinal Numbers\n\nParse ordinal words automatically — no special options needed:\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'en-US' });\n\ntoNumbers.convert('First');\n// 1\n\ntoNumbers.convert('Twenty Third');\n// 23\n\ntoNumbers.convert('One Hundredth');\n// 100\n\ntoNumbers.convert('One Thousand Two Hundred Thirty Fourth');\n// 1234\n```\n\n### Currency Parsing\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'en-IN' });\n\ntoNumbers.convert('Four Hundred Fifty Two Rupees Only', { currency: true });\n// 452\n\ntoNumbers.convert('Four Hundred Fifty Two Rupees And Thirty Six Paise Only', { currency: true });\n// 452.36\n\n// Works without \"Only\" suffix too\ntoNumbers.convert('Four Hundred Fifty Two Rupees', { currency: true });\n// 452\n\n// Fractional units only\ntoNumbers.convert('Thirty Six Paise Only', { currency: true });\n// 0.36\n```\n\n### Fraction-Style Decimals\n\nLocales with fraction denominator vocabularies can parse decimal phrases without digit-by-digit notation:\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'en-US' });\n\ntoNumbers.convert('Forty Five Hundredths');\n// 0.45\n\ntoNumbers.convert('Zero Point Three Hundredths');\n// 0.03\n```\n\nThis is available across the locales that ship `fractionDenominatorMapping`, including English, Spanish, French, German, Hindi, Persian, and other fraction-style locales.\n\n### Gendered Number Forms\n\nGender-aware locales accept the feminine or masculine forms that `to-words` emits:\n\n```js\nconst spanish = new ToNumbers({ localeCode: 'es-ES' });\n\nspanish.convert('Veintiuna');\n// 21\n\nspanish.convert('Doscientas');\n// 200\n```\n\nThis is especially relevant for Spanish, Portuguese, Arabic, Hebrew, and several Slavic locales.\n\n### Formal Characters\n\nChinese financial and formal numerals are supported through the locale's formal character map:\n\n```js\nconst chinese = new ToNumbers({ localeCode: 'zh-CN' });\n\nchinese.convert('玖拾');\n// 90\n\nchinese.convert('萬');\n// 10000\n```\n\n### Custom Currency\n\nOverride currency settings while keeping the locale's language:\n\n```js\nconst toNumbers = new ToNumbers({\n  localeCode: 'en-US',\n  converterOptions: {\n    currency: true,\n    currencyOptions: {\n      name: 'Euro',\n      plural: 'Euros',\n      symbol: '€',\n      fractionalUnit: {\n        name: 'Cent',\n        plural: 'Cents',\n        symbol: '',\n      },\n    },\n  },\n});\n\ntoNumbers.convert('One Hundred Euros And Fifty Cents Only');\n// 100.50\n```\n\n### Functional API\n\nUse the functional helper when you want a one-liner without managing a class instance:\n\n```js\nimport { toNumbers } from 'to-numbers';\n\ntoNumbers('One Hundred Twenty Three', { localeCode: 'en-US' });\n// 123\n\ntoNumbers('One Crore');\n// 10000000 (default locale: en-IN)\n\nimport { toNumbers as enUsToNumbers } from 'to-numbers/en-US';\n\nenUsToNumbers('One Hundred Twenty Three');\n// 123\n\ntoNumbers('One Hundred Dollars Only', {\n  localeCode: 'en-US',\n  currency: true,\n});\n// 100\n```\n\nThe root helper caches parser instances by locale code, so repeated calls do not recreate locale classes.\nPer-locale helpers such as `to-numbers/en-US` use a single cached instance and do not require `localeCode`.\n\n### Tree-Shakeable Imports\n\nImport only the locales you need for smaller bundle sizes:\n\n```js\n// Import specific locale directly (includes both the class and functional helper)\nimport { ToNumbers, toNumbers as enUsToNumbers } from 'to-numbers/en-US';\n\nconst toNumbers = new ToNumbers();\ntoNumbers.convert('Twelve Thousand Three Hundred Forty Five');\n// 12345\n\nenUsToNumbers('One Hundred Twenty Three');\n// 123\n```\n\n### Browser Usage (UMD)\n\n```html\n<!-- Single locale (recommended, smaller bundle) -->\n<script src=\"https://cdn.jsdelivr.net/npm/to-numbers/dist/umd/en-US.min.js\"></script>\n<script>\n  // ToNumbers is pre-configured for en-US\n  const toNumbers = new ToNumbers();\n  console.log(toNumbers.convert('Twelve Thousand'));\n  // 12000\n</script>\n\n<!-- Full bundle with all locales -->\n<script src=\"https://cdn.jsdelivr.net/npm/to-numbers/dist/umd/to-numbers.min.js\"></script>\n<script>\n  // Specify locale when using full bundle\n  const toNumbers = new ToNumbers({ localeCode: 'fr-FR' });\n  console.log(toNumbers.convert('Douze Mille'));\n  // 12000\n</script>\n```\n\n## 🖥️ CLI\n\n```bash\nnpx to-numbers --words \"One Hundred Twenty Three\" --locale en-US\n# 123\n\nnpx to-numbers --words \"One Hundred Dollars Only\" --locale en-US --currency\n# 100\n\nnpx to-numbers \"Forty Five Hundredths\" --locale en-US\n# 0.45\n\nnpx to-numbers --help\n```\n\nSupported flags:\n\n| Flag              | Description                              |\n| ----------------- | ---------------------------------------- |\n| `--words <text>`  | Provide the text to parse explicitly     |\n| `--locale <code>` | Choose the locale, defaulting to `en-IN` |\n| `--currency`      | Parse the input as a currency amount     |\n| `-h`, `--help`    | Show help and usage examples             |\n\nYou can also pass the input as positional text instead of `--words`, but not both at the same time.\n\n## ⚛️ Framework Integration\n\n### React\n\n```tsx\nimport { ToNumbers } from 'to-numbers/en-US';\n\nconst toNumbers = new ToNumbers();\n\nfunction ParsedAmount({ text }: { text: string }) {\n  const amount = toNumbers.convert(text, { currency: true });\n  return <span className=\"amount\">${amount.toFixed(2)}</span>;\n}\n\n// Usage: <ParsedAmount text=\"One Thousand Two Hundred Thirty Four Dollars\" />\n// Renders: $1234.00\n```\n\n### Vue 3\n\n```vue\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { ToNumbers } from 'to-numbers/en-US';\n\nconst props = defineProps<{ text: string }>();\nconst toNumbers = new ToNumbers();\n\nconst amount = computed(() => toNumbers.convert(props.text, { currency: true }));\n</script>\n\n<template>\n  <span class=\"amount\">${{ amount.toFixed(2) }}</span>\n</template>\n```\n\n### Angular\n\n```typescript\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { ToNumbers } from 'to-numbers/en-US';\n\n@Pipe({ name: 'toNumbers', standalone: true })\nexport class ToNumbersPipe implements PipeTransform {\n  private toNumbers = new ToNumbers();\n\n  transform(value: string, currency = false): number {\n    return this.toNumbers.convert(value, { currency });\n  }\n}\n\n// Usage: {{ 'One Thousand Dollars' | toNumbers:true }}\n```\n\n### Svelte\n\n```svelte\n<script lang=\"ts\">\n  import { ToNumbers } from 'to-numbers/en-US';\n\n  export let text: string;\n\n  const toNumbers = new ToNumbers();\n  $: amount = toNumbers.convert(text, { currency: true });\n</script>\n\n<span class=\"amount\">${amount.toFixed(2)}</span>\n```\n\n## 🌍 Numbering Systems\n\nDifferent regions use different numbering systems. This library supports Western, Indian, East Asian, and locale-specific traditional groupings.\n\n### Short Scale (Western)\n\nUsed in: USA, UK, Canada, Australia, and most English-speaking countries.\n\n| Number | Name        |\n| ------ | ----------- |\n| 10^6   | Million     |\n| 10^9   | Billion     |\n| 10^12  | Trillion    |\n| 10^15  | Quadrillion |\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'en-US' });\ntoNumbers.convert('One Quintillion');\n// 1000000000000000000\n```\n\n### Long Scale (European)\n\nUsed in: Germany, France, and many European countries.\n\n| Number | German    | French   |\n| ------ | --------- | -------- |\n| 10^6   | Million   | Million  |\n| 10^9   | Milliarde | Milliard |\n| 10^12  | Billion   | Billion  |\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'de-DE' });\ntoNumbers.convert('Eins Milliarde');\n// 1000000000\n```\n\n### Indian System\n\nUsed in: India, Bangladesh, Nepal, Pakistan.\n\n| Number | Name   |\n| ------ | ------ |\n| 10^5   | Lakh   |\n| 10^7   | Crore  |\n| 10^9   | Arab   |\n| 10^11  | Kharab |\n| 10^13  | Neel   |\n| 10^15  | Padma  |\n| 10^17  | Shankh |\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'en-IN' });\ntoNumbers.convert('Five Lakh Twenty Three Thousand');\n// 523000\n\ntoNumbers.convert('Two Crore Fifty Lakh');\n// 25000000\n\nconst toNumbersHindi = new ToNumbers({ localeCode: 'hi-IN' });\ntoNumbersHindi.convert('एक करोड़');\n// 10000000\n```\n\n### East Asian System\n\nUsed in: Japan, China, Taiwan, Hong Kong, and Korea.\n\n| Number | Character     |\n| ------ | ------------- |\n| 10^4   | 万 (Man/Wan)  |\n| 10^8   | 億 (Oku/Yi)   |\n| 10^12  | 兆 (Chō/Zhao) |\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'zh-CN' });\ntoNumbers.convert('一亿');\n// 100000000\n```\n\n### Burmese System\n\nUsed in: Myanmar.\n\n| Number | Word   |\n| ------ | ------ |\n| 10^4   | သောင်း |\n| 10^5   | သိန်း  |\n| 10^6   | သန်း   |\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'my-MM' });\ntoNumbers.convert('တစ်သိန်း');\n// 100000\n```\n\n### Khmer System\n\nUsed in: Cambodia.\n\n| Number | Word |\n| ------ | ---- |\n| 10^4   | មុឺន |\n| 10^5   | សែន  |\n| 10^6   | លាន  |\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'km-KH' });\ntoNumbers.convert('មួយសែន');\n// 100000\n```\n\n### Scale-First Ordering\n\nUsed in: Igbo (`ig-NG`).\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'ig-NG' });\ntoNumbers.convert('Puku Abụọ');\n// 2000\n```\n\n## ⚙️ API Reference\n\n### Constructor Options\n\n```typescript\ninterface ToNumbersOptions {\n  localeCode?: string; // Default: 'en-IN'\n  converterOptions?: {\n    currency?: boolean; // Default: false\n    currencyOptions?: {\n      // Override locale's currency settings\n      name: string;\n      singular: string;\n      plural: string;\n      symbol: string;\n      fractionalUnit: {\n        name: string;\n        singular: string;\n        plural: string;\n        symbol: string;\n      };\n    };\n  };\n}\n```\n\n### Methods\n\n#### `convert(text, options?)`\n\nConverts words to a number.\n\n- **text**: `string` — The text containing number words to convert\n- **options**: `ConverterOptions` — Override instance options\n- **returns**: `number` — The parsed numeric value\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'en-US' });\n\ntoNumbers.convert('One Hundred Twenty Three');\n// 123\n\ntoNumbers.convert('Fifty Dollars Only', { currency: true });\n// 50\n```\n\n#### `parse(text, options?)`\n\nParses words and returns metadata about the result.\n\n- **text**: `string` — The text containing number words to convert\n- **options**: `ConverterOptions` — Override instance options\n- **returns**: `ParseResult` — Numeric value plus flags such as `isCurrency`, `isNegative`, and `isOrdinal`\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'zh-CN' });\n\ntoNumbers.parse('玖拾');\n// { value: 90, isCurrency: false, isNegative: false }\n```\n\n#### `toNumbers(text, options?)`\n\nFunctional equivalent of `convert()` for the full bundle.\n\n- Accepts the same converter options as `convert()` plus `localeCode`\n- Uses cached instances internally\n- Defaults to `en-IN` when `localeCode` is omitted\n\n### Converter Options\n\n| Option            | Type    | Default   | Description                                       |\n| ----------------- | ------- | --------- | ------------------------------------------------- |\n| `currency`        | boolean | false     | Parse as currency with locale-specific formatting |\n| `currencyOptions` | object  | undefined | Override locale's default currency settings       |\n\n## 🧪 Benchmarks\n\nThe benchmark suite covers the common parsing paths plus newer parser features such as:\n\n- Fraction-style decimals in `en-US`\n- Gendered forms in `es-ES`\n- Formal characters in `zh-CN`\n\nRun them locally with:\n\n```bash\nnpm run bench\n```\n\n## 📏 Bundle Sizes\n\n| Import Method                  | Raw       | Gzip     |\n| ------------------------------ | --------- | -------- |\n| Full bundle (all 124 locales)  | 713.93 KB | 70.41 KB |\n| Smallest locale bundle (si-LK) | 22.67 KB  | 6.32 KB  |\n| Average locale bundle          | —         | 6.77 KB  |\n| Largest locale bundle (ta-IN)  | 43.55 KB  | 7.74 KB  |\n\n> **Tip:** Use tree-shakeable imports or single-locale UMD bundles for the smallest bundle size.\n\n## 🌐 Browser Compatibility\n\n| Browser | Version |\n| ------- | ------- |\n| Chrome  | 49+     |\n| Firefox | 52+     |\n| Safari  | 10+     |\n| Edge    | 14+     |\n| Opera   | 36+     |\n\n## 🗺️ Supported Locales\n\nAll 124 locales with their currencies and numbering systems:\n\n| Locale | Language        | Country             | Currency      | Scale      |\n| ------ | --------------- | ------------------- | ------------- | ---------- |\n| af-ZA  | Afrikaans       | South Africa        | Rand          | Short      |\n| am-ET  | Amharic         | Ethiopia            | ብር            | Short      |\n| ar-AE  | Arabic          | UAE                 | درهم          | Short      |\n| ar-LB  | Arabic          | Lebanon             | ليرة          | Short      |\n| ar-MA  | Arabic          | Morocco             | درهم          | Short      |\n| ar-SA  | Arabic          | Saudi Arabia        | ريال          | Short      |\n| as-IN  | Assamese        | India               | টকা           | Indian     |\n| az-AZ  | Azerbaijani     | Azerbaijan          | Manat         | Short      |\n| be-BY  | Belarusian      | Belarus             | Рубель        | Short      |\n| bg-BG  | Bulgarian       | Bulgaria            | Лев           | Short      |\n| bn-BD  | Bengali         | Bangladesh          | টাকা          | Indian     |\n| bn-IN  | Bengali         | India               | টাকা          | Indian     |\n| ca-ES  | Catalan         | Spain               | Euro          | Short      |\n| cs-CZ  | Czech           | Czech Republic      | Koruna        | Short      |\n| da-DK  | Danish          | Denmark             | Krone         | Long       |\n| de-AT  | German          | Austria             | Euro          | Long       |\n| de-CH  | German          | Switzerland         | Franken       | Long       |\n| de-DE  | German          | Germany             | Euro          | Long       |\n| ee-EE  | Estonian        | Estonia             | Euro          | Short      |\n| el-GR  | Greek           | Greece              | Ευρώ          | Short      |\n| en-AE  | English         | UAE                 | Dirham        | Short      |\n| en-AU  | English         | Australia           | Dollar        | Short      |\n| en-BD  | English         | Bangladesh          | Taka          | Indian     |\n| en-CA  | English         | Canada              | Dollar        | Short      |\n| en-GB  | English         | United Kingdom      | Pound         | Short      |\n| en-GH  | English         | Ghana               | Cedi          | Short      |\n| en-HK  | English         | Hong Kong           | Dollar        | Short      |\n| en-IE  | English         | Ireland             | Euro          | Short      |\n| en-IN  | English         | India               | Rupee         | Indian     |\n| en-JM  | English         | Jamaica             | Dollar        | Short      |\n| en-KE  | English         | Kenya               | Shilling      | Short      |\n| en-LK  | English         | Sri Lanka           | Rupee         | Short      |\n| en-MA  | English         | Morocco             | Dirham        | Short      |\n| en-MM  | English         | Myanmar             | Kyat          | Short      |\n| en-MU  | English         | Mauritius           | Rupee         | Indian     |\n| en-MY  | English         | Malaysia            | Ringgit       | Short      |\n| en-NG  | English         | Nigeria             | Naira         | Short      |\n| en-NP  | English         | Nepal               | Rupee         | Indian     |\n| en-NZ  | English         | New Zealand         | Dollar        | Short      |\n| en-OM  | English         | Oman                | Rial          | Short      |\n| en-PH  | English         | Philippines         | Peso          | Short      |\n| en-PK  | English         | Pakistan            | Rupee         | Indian     |\n| en-SA  | English         | Saudi Arabia        | Riyal         | Short      |\n| en-SG  | English         | Singapore           | Dollar        | Short      |\n| en-TT  | English         | Trinidad and Tobago | Dollar        | Short      |\n| en-TZ  | English         | Tanzania            | Shilling      | Short      |\n| en-UG  | English         | Uganda              | Shilling      | Short      |\n| en-US  | English         | USA                 | Dollar        | Short      |\n| en-ZA  | English         | South Africa        | Rand          | Short      |\n| en-ZW  | English         | Zimbabwe            | Zimbabwe Gold | Short      |\n| es-AR  | Spanish         | Argentina           | Peso          | Short      |\n| es-CL  | Spanish         | Chile               | Peso          | Short      |\n| es-CO  | Spanish         | Colombia            | Peso          | Short      |\n| es-ES  | Spanish         | Spain               | Euro          | Short      |\n| es-MX  | Spanish         | Mexico              | Peso          | Short      |\n| es-US  | Spanish         | USA                 | Dólar         | Short      |\n| es-VE  | Spanish         | Venezuela           | Bolívar       | Short      |\n| fa-IR  | Persian         | Iran                | تومان         | Short      |\n| fi-FI  | Finnish         | Finland             | Euro          | Short      |\n| fil-PH | Filipino        | Philippines         | Piso          | Short      |\n| fr-BE  | French          | Belgium             | Euro          | Long       |\n| fr-CA  | French          | Canada              | Dollar        | Long       |\n| fr-CH  | French          | Switzerland         | Franc         | Long       |\n| fr-FR  | French          | France              | Euro          | Long       |\n| fr-MA  | French          | Morocco             | Dirham        | Long       |\n| fr-SA  | French          | Saudi Arabia        | Riyal         | Long       |\n| gu-IN  | Gujarati        | India               | રૂપિયો        | Indian     |\n| ha-NG  | Hausa           | Nigeria             | Naira         | Short      |\n| hbo-IL | Biblical Hebrew | Israel              | שקל           | Short      |\n| he-IL  | Hebrew          | Israel              | שקל           | Short      |\n| hi-IN  | Hindi           | India               | रुपया         | Indian     |\n| hr-HR  | Croatian        | Croatia             | Euro          | Short      |\n| hu-HU  | Hungarian       | Hungary             | Forint        | Short      |\n| id-ID  | Indonesian      | Indonesia           | Rupiah        | Short      |\n| ig-NG  | Igbo            | Nigeria             | Naira         | Short      |\n| is-IS  | Icelandic       | Iceland             | Króna         | Short      |\n| it-IT  | Italian         | Italy               | Euro          | Short      |\n| ja-JP  | Japanese        | Japan               | 円            | East Asian |\n| jv-ID  | Javanese        | Indonesia           | Rupiah        | Short      |\n| ka-GE  | Georgian        | Georgia             | ლარი          | Short      |\n| km-KH  | Khmer           | Cambodia            | រៀល           | Khmer      |\n| kn-IN  | Kannada         | India               | ರೂಪಾಯಿ        | Indian     |\n| ko-KR  | Korean          | South Korea         | 원            | East Asian |\n| lt-LT  | Lithuanian      | Lithuania           | Euras         | Short      |\n| lv-LV  | Latvian         | Latvia              | Eiro          | Short      |\n| ml-IN  | Malayalam       | India               | രൂപ           | Indian     |\n| mr-IN  | Marathi         | India               | रुपया         | Indian     |\n| ms-MY  | Malay           | Malaysia            | Ringgit       | Short      |\n| ms-SG  | Malay           | Singapore           | Dolar         | Short      |\n| my-MM  | Burmese         | Myanmar             | ကျပ်          | Burmese    |\n| nb-NO  | Norwegian       | Norway              | Krone         | Long       |\n| nl-NL  | Dutch           | Netherlands         | Euro          | Short      |\n| nl-SR  | Dutch           | Suriname            | Dollar        | Short      |\n| np-NP  | Nepali          | Nepal               | रुपैयाँ       | Indian     |\n| or-IN  | Odia            | India               | ଟଙ୍କା         | Indian     |\n| pa-IN  | Punjabi         | India               | ਰੁਪਇਆ         | Indian     |\n| pl-PL  | Polish          | Poland              | Złoty         | Short      |\n| pt-AO  | Portuguese      | Angola              | Kwanza        | Short      |\n| pt-BR  | Portuguese      | Brazil              | Real          | Short      |\n| pt-MZ  | Portuguese      | Mozambique          | Metical       | Short      |\n| pt-PT  | Portuguese      | Portugal            | Euro          | Short      |\n| ro-RO  | Romanian        | Romania             | Leu           | Short      |\n| ru-RU  | Russian         | Russia              | Рубль         | Short      |\n| si-LK  | Sinhala         | Sri Lanka           | රුපියල        | Indian     |\n| sk-SK  | Slovak          | Slovakia            | Euro          | Short      |\n| sl-SI  | Slovenian       | Slovenia            | Euro          | Short      |\n| sq-AL  | Albanian        | Albania             | Lek           | Short      |\n| sr-RS  | Serbian         | Serbia              | Dinar         | Short      |\n| sv-SE  | Swedish         | Sweden              | Krona         | Short      |\n| sw-KE  | Swahili         | Kenya               | Shilingi      | Short      |\n| sw-TZ  | Swahili         | Tanzania            | Shilingi      | Short      |\n| ta-IN  | Tamil           | India               | ரூபாய்        | Indian     |\n| te-IN  | Telugu          | India               | రూపాయి        | Indian     |\n| th-TH  | Thai            | Thailand            | บาท           | Short      |\n| tr-TR  | Turkish         | Turkey              | Lira          | Short      |\n| uk-UA  | Ukrainian       | Ukraine             | Гривня        | Short      |\n| ur-PK  | Urdu            | Pakistan            | روپیہ         | Indian     |\n| uz-UZ  | Uzbek           | Uzbekistan          | So'm          | Short      |\n| vi-VN  | Vietnamese      | Vietnam             | Đồng          | Short      |\n| yo-NG  | Yoruba          | Nigeria             | Naira         | Short      |\n| yue-HK | Cantonese       | Hong Kong           | 元            | East Asian |\n| zh-CN  | Chinese         | China               | 元            | East Asian |\n| zh-TW  | Chinese         | Taiwan              | 元            | East Asian |\n| zu-ZA  | Zulu            | South Africa        | Rand          | Short      |\n\n**Scale Legend:**\n\n- **Short** — Western short scale (Million, Billion, Trillion...)\n- **Long** — European long scale (Million, Milliard, Billion, Billiard...)\n- **Indian** — Indian numbering (Lakh, Crore, Arab, Kharab...)\n- **East Asian** — East Asian numbering (万, 億, 兆, 京...)\n- **Burmese** — Burmese traditional scale (သောင်း = 10k, သိန်း = 100k, သန်း = 1M)\n- **Khmer** — Khmer traditional scale (មុឺន = 10k, សែន = 100k, លាន = 1M)\n\n**Ordinal Coverage:** all 124 locales ship ordinal data, so `convert()` and `parse()` can recognise ordinal inputs without extra flags.\n\n**Formal Numerals:** `zh-CN` and `zh-TW` support formal and financial Chinese numerals (大写 / 大寫).\n\n**Scale-First Ordering:** `ig-NG` uses scale-first phrases such as `Puku Abụọ` for 2000.\n\n## ⚠️ Error Handling\n\nThe library throws descriptive errors for invalid inputs:\n\n### Invalid Input\n\n```js\nconst toNumbers = new ToNumbers();\n\ntoNumbers.convert('');\n// Error: Invalid Input \"\"\n\ntoNumbers.convert('   ');\n// Error: Invalid Input \"   \"\n```\n\n### Unknown Locale\n\n```js\nconst toNumbers = new ToNumbers({ localeCode: 'xx-XX' });\ntoNumbers.convert('One');\n// Error: Unknown Locale \"xx-XX\"\n```\n\n### Handling Errors\n\n```js\ntry {\n  const amount = toNumbers.convert(userInput, { currency: true });\n  console.log('Parsed amount:', amount);\n} catch (error) {\n  console.error('Parsing failed:', error.message);\n}\n```\n\n## 💖 Support\n\nIf `to-numbers` is useful in your work, consider supporting ongoing maintenance through [GitHub Sponsors](https://github.com/sponsors/mastermunj).\n\nAfter installation, `npm fund to-numbers` surfaces the same funding link from npm metadata.\n\n## 🤝 Contributing\n\nContributions are welcome. This project follows the [Code of Conduct](CODE_OF_CONDUCT.md).\n\nFor security issues, follow [SECURITY.md](SECURITY.md) and use private disclosure rather than a public issue.\n\n### Adding a New Locale\n\n1. **Create the locale file**: Add `src/locales/<locale-code>.ts` implementing `LocaleInterface` from `src/types.ts`. Use an existing locale as a template.\n\n2. **Register the locale**: Import your class in `src/locales/index.ts` and add it to the `LOCALES` map.\n\n3. **Add tests**: Create `__tests__/<locale-code>.test.ts` covering integers, negatives, decimals, and currency parsing.\n\n4. **Update documentation**: Add the locale to the Supported Locales section above.\n\n5. **Build and test**: Run `npm test` and `npm run build`, then submit your PR.\n\n## ❓ FAQ\n\n<details>\n<summary><strong>How does this relate to the to-words package?</strong></summary>\n\n`to-numbers` is the reverse of `to-words`. While `to-words` converts `123` → `\"One Hundred Twenty Three\"`, `to-numbers` converts `\"One Hundred Twenty Three\"` → `123`.\n\nThey share the same locale support and are designed to work together:\n\n```js\nimport { ToWords } from 'to-words';\nimport { ToNumbers } from 'to-numbers';\n\nconst toWords = new ToWords({ localeCode: 'en-US' });\nconst toNumbers = new ToNumbers({ localeCode: 'en-US' });\n\nconst words = toWords.convert(12345);\n// \"Twelve Thousand Three Hundred Forty Five\"\n\nconst number = toNumbers.convert(words);\n// 12345 ✓ Round-trip complete!\n```\n\n</details>\n\n<details>\n<summary><strong>Is parsing case-sensitive?</strong></summary>\n\nNo! The parser is fully case-insensitive:\n\n```js\ntoNumbers.convert('one hundred'); // 100\ntoNumbers.convert('ONE HUNDRED'); // 100\ntoNumbers.convert('One Hundred'); // 100\ntoNumbers.convert('oNe HuNdReD'); // 100\n```\n\n</details>\n\n<details>\n<summary><strong>Can I parse currency from different locales?</strong></summary>\n\nYes! Each locale has its own currency configuration:\n\n```js\n// Indian Rupees\nconst tnIN = new ToNumbers({ localeCode: 'en-IN' });\ntnIN.convert('Five Hundred Rupees Only', { currency: true });\n// 500\n\n// US Dollars\nconst tnUS = new ToNumbers({ localeCode: 'en-US' });\ntnUS.convert('Five Hundred Dollars Only', { currency: true });\n// 500\n\n// French Euros\nconst tnFR = new ToNumbers({ localeCode: 'fr-FR' });\ntnFR.convert('Cinq Cents Euros', { currency: true });\n// 500\n```\n\n</details>\n\n<details>\n<summary><strong>Does this work in the browser?</strong></summary>\n\nYes! Use the UMD bundles via CDN:\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/to-numbers/dist/umd/en-US.min.js\"></script>\n<script>\n  const toNumbers = new ToNumbers();\n  console.log(toNumbers.convert('One Hundred Twenty Three'));\n  // 123\n</script>\n```\n\n</details>\n\n<details>\n<summary><strong>How do I add support for a new locale?</strong></summary>\n\nSee the [Contributing](#-contributing) section above. You'll need to create a locale file implementing the `LocaleInterface` and add tests.\n\n</details>\n\n<details>\n<summary><strong>What about ordinal numbers (First, Second, Third)?</strong></summary>\n\nOrdinal parsing is available across all 124 locales in the current release. `convert()` and `parse()` automatically detect ordinal inputs, including suffix-, prefix-, and exact-form ordinals:\n\n```js\nconst english = new ToNumbers({ localeCode: 'en-US' });\nenglish.convert('Twenty Third'); // 23\n\nconst chinese = new ToNumbers({ localeCode: 'zh-CN' });\nchinese.convert('第三'); // 3\n\nconst turkish = new ToNumbers({ localeCode: 'tr-TR' });\nturkish.convert('Birinci'); // 1\n```\n\n</details>\n\n## 📋 Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a detailed history of changes.\n\n## 📄 License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}