{"id":36254157,"url":"https://github.com/mojtabaahn/php-persian-number-to-words","last_synced_at":"2026-01-11T07:04:27.083Z","repository":{"id":325917937,"uuid":"284905760","full_name":"mojtabaahn/php-persian-number-to-words","owner":"mojtabaahn","description":"Convert numbers to words in Persian","archived":false,"fork":false,"pushed_at":"2023-09-29T09:34:05.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T15:28:25.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mojtabaahn.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-04T07:14:19.000Z","updated_at":"2025-10-06T14:01:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mojtabaahn/php-persian-number-to-words","commit_stats":null,"previous_names":["mojtabaahn/php-persian-number-to-words"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mojtabaahn/php-persian-number-to-words","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojtabaahn%2Fphp-persian-number-to-words","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojtabaahn%2Fphp-persian-number-to-words/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojtabaahn%2Fphp-persian-number-to-words/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojtabaahn%2Fphp-persian-number-to-words/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mojtabaahn","download_url":"https://codeload.github.com/mojtabaahn/php-persian-number-to-words/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojtabaahn%2Fphp-persian-number-to-words/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28296941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-11T07:04:26.356Z","updated_at":"2026-01-11T07:04:27.072Z","avatar_url":"https://github.com/mojtabaahn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convert Numbers to Words In Persian\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/mojtabaahn/php-persian-number-to-words.svg?style=flat-square)](https://packagist.org/packages/mojtabaahn/php-persian-number-to-words)\n[![Total Downloads](https://img.shields.io/packagist/dt/mojtabaahn/php-persian-number-to-words?style=flat-square)](https://packagist.org/packages/mojtabaahn/php-persian-number-to-words)\n[![Repo Size](https://img.shields.io/github/repo-size/mojtabaahn/php-persian-number-to-words?style=flat-square)](https://packagist.org/packages/mojtabaahn/php-persian-number-to-words)\n[![Repo Size](https://img.shields.io/packagist/l/mojtabaahn/php-persian-number-to-words?style=flat-square)](https://packagist.org/packages/mojtabaahn/php-persian-number-to-words)\n\nThis 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.\n\n## Requirement\n\nThis package requires **PHP 7.4** or higher.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require mojtabaahn/php-persian-number-to-words\n```\n\n## Usage\n\n``` php\n$dictionary = new MojtabaaHN\\PersianNumberToWords\\Dictionary();\n\n$converter = new MojtabaaHN\\PersianNumberToWords\\PersianNumberToWords($dictionary);\n\necho $converter-\u003econvert(0);\n// صفر\n\necho $converter-\u003econvert(-10);\n// منفی ده\n\necho $converter-\u003econvert(229);\n// دویست و بیست و نه\n\necho $converter-\u003econvert(999999999);\n// نهصد و نود و نه میلیون و نهصد و نود و نه هزار و نهصد و نود و نه\n```\n## Configuration\n\nIt is possible to customize the way output should look like using Dictionary class setter methods.\n\n``` php\n$dictionary = (new MojtabaaHN\\PersianNumberToWords\\Dictionary())\n    -\u003esetZero('هیچ')\n    -\u003esetNegative('منهای')\n    -\u003esetSeparator(' ُ ');\n\n// Also -\u003esetUnits(array $units) \u0026 -\u003e setSuffixes(array $suffixes) are availabe\n\n$converter = new MojtabaaHN\\PersianNumberToWords\\PersianNumberToWords($dictionary);\n\necho $converter-\u003econvert(0);\n// هیچ\n\necho $converter-\u003econvert(-10);\n// منهای ده\n\necho $converter-\u003econvert(229);\n// دویست ُ بیست ُ نه\n\n```\n\n## Default Configuration\nThis code is a part of Dictionary class, you can see all default Configuration:\n```php\nclass Dictionary\n{\n\n    protected string $zero = 'صفر';\n\n    protected string $negative = 'منفی';\n\n    protected string $separator = \" و \";\n\n    protected array $units = [\n        1 =\u003e 'یک',\n        2 =\u003e 'دو',\n        3 =\u003e 'سه',\n        4 =\u003e 'چهار',\n        5 =\u003e 'پنج',\n        6 =\u003e 'شش',\n        7 =\u003e 'هفت',\n        8 =\u003e 'هشت',\n        9 =\u003e 'نه',\n        10 =\u003e 'ده',\n        11 =\u003e 'یازده',\n        12 =\u003e 'دوازده',\n        13 =\u003e 'سیزده',\n        14 =\u003e 'چهارده',\n        15 =\u003e 'پانزده',\n        16 =\u003e 'شانزده',\n        17 =\u003e 'هفده',\n        18 =\u003e 'هجده',\n        19 =\u003e 'نوزده',\n        20 =\u003e 'بیست',\n        30 =\u003e 'سی',\n        40 =\u003e 'چهل',\n        50 =\u003e 'پنجاه',\n        60 =\u003e 'شصت',\n        70 =\u003e 'هفتاد',\n        80 =\u003e 'هشتاد',\n        90 =\u003e 'نود',\n        100 =\u003e 'صد',\n        200 =\u003e 'دویست',\n        300 =\u003e 'سیصد',\n        400 =\u003e 'چهارصد',\n        500 =\u003e 'پانصد',\n        600 =\u003e 'ششصد',\n        700 =\u003e 'هفتصد',\n        800 =\u003e 'هشتصد',\n        900 =\u003e 'نهصد'\n    ];\n\n    protected array $suffixes = [\n        3 =\u003e 'هزار',\n        6 =\u003e 'میلیون',\n        9 =\u003e 'میلیارد',\n        12 =\u003e 'بیلیون',\n        15 =\u003e 'بیلیارد',\n        18 =\u003e 'تریلیون',\n        21 =\u003e 'تریلیارد',\n        24 =\u003e 'کوآدریلیون',\n        27 =\u003e 'کادریلیارد',\n        30 =\u003e 'کوینتیلیون',\n        33 =\u003e 'کوانتینیارد',\n        36 =\u003e 'سکستیلیون',\n        39 =\u003e 'سکستیلیارد',\n        42 =\u003e 'سپتیلیون',\n        45 =\u003e 'سپتیلیارد',\n        48 =\u003e 'اکتیلیون',\n        51 =\u003e 'اکتیلیارد',\n        54 =\u003e 'نانیلیون',\n        57 =\u003e 'نانیلیارد',\n        60 =\u003e 'دسیلیون',\n        63 =\u003e 'دسیلیارد',\n    ];\n\n    // Setters \u0026 Helpers...\n\n}\n```\n\n## Testing\n\n``` bash\ncomposer test\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojtabaahn%2Fphp-persian-number-to-words","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmojtabaahn%2Fphp-persian-number-to-words","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojtabaahn%2Fphp-persian-number-to-words/lists"}