ediphas / bnspellnum
Spell out numbers in Bangla: words, currency (taka/paisa), ordinals, years and dates. Zero dependencies.
v0.1.0
2026-11-28 03:18 UTC
Requires
- php: >=8.1
Requires (Dev)
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-28 16:31:39 UTC
README
Spell out numbers in Bangla: words, taka/paisa, ordinals, years and dates.
Zero dependencies (no bcmath or gmp), PHP ≥ 8.1. Implements the
bnspellnum spec 1.0.0,
and gives the same output as the Python, JavaScript, C# and C++ packages.
This directory is mirrored to ediphasLabs/bnspellnum-php for Packagist. Please open issues and pull requests on the main repository.
composer require ediphas/bnspellnum
use Ediphas\BnSpellNum\BnSpellNum; BnSpellNum::words(1250000); // "বারো লাখ পঞ্চাশ হাজার" BnSpellNum::words(200, style: 'formal'); // "দুইশত" BnSpellNum::words('-3.25'); // "ঋণাত্মক তিন দশমিক দুই পাঁচ" BnSpellNum::currency('1250.50', cheque: true); // "এক হাজার দুইশো পঞ্চাশ টাকা পঞ্চাশ পয়সা মাত্র" BnSpellNum::ordinal(3, short: true); // "৩য়" BnSpellNum::year(1971); // "উনিশশো একাত্তর" BnSpellNum::date(16, 12, 1971); // "ষোলোই ডিসেম্বর উনিশশো একাত্তর" BnSpellNum::date(28, 11, style: 'short'); // "২৮শে নভেম্বর" BnSpellNum::toBnDigits('2026'); // "২০২৬"
- Accepts
intand numeric strings (ASCII or Bangla digits,,separators, one.). Floats throwInvalidInputException; pass a string instead. - Errors:
InvalidInputExceptionandOutOfRangeException, both extendingBnSpellNumException(an\InvalidArgumentException).
Full documentation is in the project README. MIT © Ediphas Labs.