bnspellnum
spec 1.0.0 · 5 languages · MIT

Spell out numbers in Bangla

One specification, five languages, identical output. Words, taka and paisa, ordinals, years, dates and digits for Python, JavaScript, PHP, C# and C++.

1250000বারো লাখ পঞ্চাশ হাজার1971উনিশশো একাত্তর28/11আঠাশে নভেম্বর৳1250.50এক হাজার দুইশো পঞ্চাশ টাকা পঞ্চাশ পয়সা21stএকুশতম2026২০২৬

Install

Pick your language. Every package has the same functions and gives the same output.

pip install bnspellnum
npm install bnspellnum
composer require ediphas/bnspellnum
dotnet add package BnSpellNum
curl -L https://github.com/ediphasLabs/bnspellnum/releases/download/cpp-v0.1.0/bnspellnum-cpp-0.1.0.tar.gz | tar xz
import bnspellnum as bn

bn.words(1250000)                  # বারো লাখ পঞ্চাশ হাজার
bn.currency("1250.50")             # এক হাজার দুইশো পঞ্চাশ টাকা পঞ্চাশ পয়সা
bn.year(1971)                      # উনিশশো একাত্তর
bn.date(28, 11)                    # আঠাশে নভেম্বর
bn.ordinal(21)                     # একুশতম
bn.to_bn_digits("2026")            # ২০২৬
import { words, currency, year, date, ordinal, toBnDigits } from "bnspellnum";

words(1250000);                    // বারো লাখ পঞ্চাশ হাজার
currency("1250.50");               // এক হাজার দুইশো পঞ্চাশ টাকা পঞ্চাশ পয়সা
year(1971);                        // উনিশশো একাত্তর
date(28, 11);                      // আঠাশে নভেম্বর
ordinal(21);                       // একুশতম
toBnDigits("2026");                // ২০২৬
use Ediphas\BnSpellNum\BnSpellNum;

BnSpellNum::words(1250000);        // বারো লাখ পঞ্চাশ হাজার
BnSpellNum::currency('1250.50');   // এক হাজার দুইশো পঞ্চাশ টাকা পঞ্চাশ পয়সা
BnSpellNum::year(1971);            // উনিশশো একাত্তর
BnSpellNum::date(28, 11);          // আঠাশে নভেম্বর
BnSpellNum::ordinal(21);           // একুশতম
BnSpellNum::toBnDigits('2026');    // ২০২৬
using Ediphas.BnSpellNum;

BnSpell.Words(1250000);            // বারো লাখ পঞ্চাশ হাজার
BnSpell.Currency(1250.50m);        // এক হাজার দুইশো পঞ্চাশ টাকা পঞ্চাশ পয়সা
BnSpell.Year(1971);                // উনিশশো একাত্তর
BnSpell.Date(28, 11);              // আঠাশে নভেম্বর
BnSpell.Ordinal(21);               // একুশতম
BnSpell.ToBnDigits("2026");        // ২০২৬
#include <bnspellnum/bnspellnum.hpp>
namespace bn = bnspellnum;

bn::words(1250000);                // বারো লাখ পঞ্চাশ হাজার
bn::currency("1250.50");           // এক হাজার দুইশো পঞ্চাশ টাকা পঞ্চাশ পয়সা
bn::year(1971);                    // উনিশশো একাত্তর
bn::date(28, 11);                  // আঠাশে নভেম্বর
bn::ordinal(21);                   // একুশতম
bn::to_bn_digits("2026");          // ২০২৬

Playground

This runs the real JavaScript package in your browser. Try Bangla digits like ১২,৫০,০০০, decimals, or numbers with 25 digits.

Words words()

Currency currency()

Year year()

Date date()

Ordinal ordinal()

Digits toBnDigits()

Why bnspellnum

Bangla number words are irregular: every number from 0 to 99 has its own word, and years, dates and money are each read differently.

Identical everywhere

All five packages pass the same 719 shared test vectors, so your backend and frontend always agree.

One source of truth

Every Bangla word lives in one set of data files and is generated into each package. No hand-typed tables.

Zero dependencies

Nothing to compile, nothing to pull in. pip, npm, Composer, NuGet, or a single C++ header.

Any size

Works on digit strings, so এক লাখ কোটি and beyond work in every language without big-integer libraries.

Real-world input

Bangla digits, Indian or Western comma grouping, whitespace, exact decimals, and clear errors.

Money done right

Taka and paisa with half-up rounding and cheque-style মাত্র. Floats are rejected, so nothing drifts.

Packages

Each package has its own guide with types, options and errors. The reference covers behaviour shared by all of them.