JSPM

spellnum

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26
  • Score
    100M100P100Q48520F
  • License MIT

Convert numbers and money amounts to words in English and Korean (만/억/조) — for invoices, cheques, contracts and accessibility. Exact (BigInt), zero dependencies, 100% local.

Package Exports

  • spellnum

Readme

🔢 spellnum

Turn numbers and money amounts into words — English & Korean. Locally.

npm version bundle size CI types license

🌐 Try the free web app →  ·  type a number, get the words. English & 한국어.


Invoices, cheques and contracts ask you to write the amount in words — "one thousand two hundred thirty-four dollars and fifty-six cents", or "백이십삼만 사천원". Doing it by hand is slow and error-prone, especially in Korean, where digits group by 만/억/조 (every 4 places) instead of every 3.

spellnum does it exactly and instantly — English and Korean, numbers and currency — with BigInt precision, zero dependencies, and 100% locally.

📸 Screenshot / demo GIF: ./web/screenshot.png — record the live app typing an amount and toggling English / 한국어 / money.

Why it exists

  • AI can't reliably do this. Spelling large numbers — and Korean's myriad (만/억/조) grouping in particular — follows exact rules that language models routinely get wrong. When the words must match the figures (legal/financial documents), you need a deterministic tool, not a guess.
  • Precision. The integer part uses BigInt, so it's exact even past what a JavaScript number can hold.
  • It's everywhere, quietly. Invoicing, cheque writing, contracts, receipts, number education, and screen-reader-friendly text all need numbers as words.

Who it's for

Freelancers & small businesses (invoices/receipts), finance & ops (cheques, contracts), creators selling products/services, educators, and developers localizing apps or building accessible UIs.

Install

No install — just open the web app.

For the library:

npm install spellnum

Zero dependencies. ESM + CJS + TypeScript types. Runs in the browser, Node, Deno and Bun.

Usage

import { toWords, toCurrencyWords, toOrdinalWords } from "spellnum";

// Numbers
toWords(1234);                       // "one thousand two hundred thirty-four"
toWords(3.14);                       // "three point one four"
toWords(123, { and: true });         // "one hundred and twenty-three"

// Korean (만/억/조 grouping)
toWords(12345678, { lang: "ko" });   // "천이백삼십사만오천육백칠십팔"
toWords(10000, { lang: "ko" });      // "일만"

// Money
toCurrencyWords(1234.56);                          // "…dollars and fifty-six cents"
toCurrencyWords(99.5, { cents: "fraction" });      // "ninety-nine dollars and 50/100"
toCurrencyWords(1234000, { currency: "KRW" });     // "백이십삼만사천원"
toCurrencyWords(1.01, { currency: "GBP" });        // "one pound and one penny"

// Ordinals (English)
toOrdinalWords(21n);                 // "twenty-first"

Exactness with BigInt

toWords("1000000000000000000000"); // "one sextillion" (way past Number's safe range)
toWords(12345678901234567890n);    // exact

API

Function Description
toWords(value, { lang?, and?, negativeWord? }) Number → words (en/ko).
toCurrencyWords(amount, { currency?, lang?, cents? }) Money → words.
toOrdinalWords(bigint) English ordinal words (first, twenty-first).
bigIntToWordsEN / bigIntToWordsKO Low-level integer converters.
CURRENCIES Supported currency definitions.

value accepts a number, bigint, or numeric string (use a string/bigint for very large or high-precision values).

FAQ

Which languages are supported? English and Korean today. The architecture is per-language, so more can be added (see CONTRIBUTING).

Why Korean specifically? Korean groups digits by 만/억/조 (every 4 places), which is exactly the rule that generic tools and LLMs get wrong — and writing amounts in Korean words is common on invoices and contracts.

Is anything sent to a server? No. It runs entirely on your device — no server, no telemetry, works offline.

Does it handle decimals and money? Yes — toWords spells decimals digit-by-digit ("point one four"), and toCurrencyWords formats amounts with major/minor units (or cheque-style 56/100).

How big a number can it handle? The integer part uses BigInt, so it's exact up to "decillion"-scale names (extend SCALES/BIG for more).

Contributing

Contributions welcome! See CONTRIBUTING.md and the Code of Conduct.

git clone https://github.com/didrod205/spellnum.git
cd spellnum
npm install
npm test          # run the suite
npm run dev       # run the web app locally

💖 Sponsor

spellnum is free, MIT-licensed, and built in spare time. If it saved you from hand-writing "amount in words", please consider supporting it:

  • Star this repo — free, and it genuinely helps others find it.
  • 🍋 Sponsor via Lemon Squeezy — one-time or recurring support.

Where your support goes: more languages (Japanese, Chinese, Spanish, Hindi…), more currencies, ordinals & fractions per language, a native Korean (하나·둘) mode, keeping the free web app online, and fast issue responses.

License

MIT © spellnum contributors