PHPackages                             vanaboom/persian-number-to-word - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vanaboom/persian-number-to-word

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vanaboom/persian-number-to-word
===============================

Converts number to word in persian

1.0.1(1y ago)082MITPHPPHP ^8.2

Since Sep 4Pushed 1y ago2 watchersCompare

[ Source](https://github.com/vanaboom/persian-number-to-word)[ Packagist](https://packagist.org/packages/vanaboom/persian-number-to-word)[ Docs](https://github.com/vanaboom/persian-number-to-word)[ RSS](/packages/vanaboom-persian-number-to-word/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Convert Numbers to Words In Persian
===================================

[](#convert-numbers-to-words-in-persian)

This packages offers ability to convert numbers to words in persian. Words and phrases are fully configurable, so it is possible to use it for all persian language family with configuration.

Requirement
-----------

[](#requirement)

This package requires **PHP 8** or higher.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require apachish/php-persian-number-to-words
```

Usage
-----

[](#usage)

```
$dictionary = new Apachish\PersianNumberToWords\Dictionary();

$converter = new Apachish\PersianNumberToWords\PersianNumberToWords($dictionary);

echo $converter->convert(0);
// صفر

echo $converter->convert(-10);
// منفی ده

echo $converter->convert(229);
// دویست و بیست و نه

echo $converter->convert(999999999);
// نهصد و نود و نه میلیون و نهصد و نود و نه هزار و نهصد و نود و نه
```

Configuration
-------------

[](#configuration)

It is possible to customize the way output should look like using Dictionary class setter methods.

```
$dictionary = (new Apachish\PersianNumberToWords\Dictionary())
    ->setZero('هیچ')
    ->setNegative('منهای')
    ->setSeparator(' ُ ');

// Also ->setUnits(array $units) & -> setSuffixes(array $suffixes) are availabe

$converter = new Apachish\PersianNumberToWords\PersianNumberToWords($dictionary);

echo $converter->convert(0);
// هیچ

echo $converter->convert(-10);
// منهای ده

echo $converter->convert(229);
// دویست ُ بیست ُ نه
```

Default Configuration
---------------------

[](#default-configuration)

This code is a part of Dictionary class, you can see all default Configuration:

```
class Dictionary
{

    protected string $zero = 'صفر';

    protected string $negative = 'منفی';

    protected string $separator = " و ";

    protected array $units = [
        1 => 'یک',
        2 => 'دو',
        3 => 'سه',
        4 => 'چهار',
        5 => 'پنج',
        6 => 'شش',
        7 => 'هفت',
        8 => 'هشت',
        9 => 'نه',
        10 => 'ده',
        11 => 'یازده',
        12 => 'دوازده',
        13 => 'سیزده',
        14 => 'چهارده',
        15 => 'پانزده',
        16 => 'شانزده',
        17 => 'هفده',
        18 => 'هجده',
        19 => 'نوزده',
        20 => 'بیست',
        30 => 'سی',
        40 => 'چهل',
        50 => 'پنجاه',
        60 => 'شصت',
        70 => 'هفتاد',
        80 => 'هشتاد',
        90 => 'نود',
        100 => 'صد',
        200 => 'دویست',
        300 => 'سیصد',
        400 => 'چهارصد',
        500 => 'پانصد',
        600 => 'ششصد',
        700 => 'هفتصد',
        800 => 'هشتصد',
        900 => 'نهصد'
    ];

    protected array $suffixes = [
        3 => 'هزار',
        6 => 'میلیون',
        9 => 'میلیارد',
        12 => 'بیلیون',
        15 => 'بیلیارد',
        18 => 'تریلیون',
        21 => 'تریلیارد',
        24 => 'کوآدریلیون',
        27 => 'کادریلیارد',
        30 => 'کوینتیلیون',
        33 => 'کوانتینیارد',
        36 => 'سکستیلیون',
        39 => 'سکستیلیارد',
        42 => 'سپتیلیون',
        45 => 'سپتیلیارد',
        48 => 'اکتیلیون',
        51 => 'اکتیلیارد',
        54 => 'نانیلیون',
        57 => 'نانیلیارد',
        60 => 'دسیلیون',
        63 => 'دسیلیارد',
    ];

    // Setters & Helpers...

}
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance47

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~223 days

Total

2

Last Release

392d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4df8b5119bebeb027eaa90a5393bb6b8db879b2a41262952c448477346a181d6?d=identicon)[vanaboom](/maintainers/vanaboom)

---

Tags

persiannumbers-to-words

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/vanaboom-persian-number-to-word/health.svg)

```
[![Health](https://phpackages.com/badges/vanaboom-persian-number-to-word/health.svg)](https://phpackages.com/packages/vanaboom-persian-number-to-word)
```

###  Alternatives

[fisharebest/ext-calendar

Implementation of the Arabic (Hijri), French, Gregorian, Jewish, Julian and Persian (Jalali) calendars. Also provides a replacement for the PHP ext/calendar extension.

36473.2k8](/packages/fisharebest-ext-calendar)[opilo/farsi

Farsi Tools for Dates and Numbers and Strings (with Laravel Validation Support)

333.2k1](/packages/opilo-farsi)[pishran/laravel-persian-string

Convert Arabic/English/etc numbers and characters to Persian numbers and characters in Laravel models.

206.7k](/packages/pishran-laravel-persian-string)[aloko/nova-persian-datepicker

Persian Datepicker for Laravel Nova.

203.5k](/packages/aloko-nova-persian-datepicker)[symfony_persia/symfonyjdate

Jalali (Shamsi) DateTime for Symfony2, Supports year higher than 2038

1010.6k](/packages/symfony-persia-symfonyjdate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
