PHPackages                             splendour/number-to-text - 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. splendour/number-to-text

ActiveLibrary

splendour/number-to-text
========================

Convert number to text

1.0.0(5y ago)232MITPHPPHP ^7.1.3|^8.0

Since Feb 16Pushed 4y agoCompare

[ Source](https://github.com/gduymaz/number-to-text)[ Packagist](https://packagist.org/packages/splendour/number-to-text)[ Docs](https://github.com/gduymaz/number-to-text)[ RSS](/packages/splendour-number-to-text/feed)WikiDiscussions main Synced today

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

PHP Number to text (words) converter
====================================

[](#php-number-to-text-words-converter)

This library allows you to convert a number to text or money.

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

[](#installation)

Add package to your composer.json by running:

```
$ composer require splendour/number-to-text

```

Usage
-----

[](#usage)

This library currently has two types of number-to-text transformations: number and currency. In order to use a specific transformer for certain language you need to create an instance of `NumberToText` class and then call a method which creates a new instance of a transformer;

### Number Transformer

[](#number-transformer)

Before using a transformer, it must be created:

```
use Splendour\NumberToText;

// create the number to text "transformer" class
$transformer = new NumberToText(1);

// set translation using the RFC 3066 language identifier
$transformer->setTranslation('tr'); //en is default
```

Then it can be used with the `toText()` method:

```
$transformer->toText(); // outputs "one"
```

### Examples

[](#examples)

#### Number to text

[](#number-to-text)

```
$text = new NumberToText(11);
$text->toText(); //eleven

$text = new NumberToText(1253);
$text->setTranslation('tr');
$text->toText(); //bin ikiyüzelliüç

$text = new NumberToText(6420729122344886326918433610716);
$text->toText(); //six nonillion fourhundredtwenty octillion sevenhundredtwentynine septillion onehundredtwentytwo sextillion threehundredfortyfour quintillion eighthundredeightysix quadrillion twohundredseventytwo trillion onehundredsixtyeight billion sixhundredsixteen million fourhundredtwentyfour thousand onehundredsixtyeight

```

#### Number to money

[](#number-to-money)

```
$money = new NumberToText(4563.24);
$money->toMoney('dollars', 'cents') //four thousand fivehundredsixtythree dollars twentyfour cents

```

Contributing
------------

[](#contributing)

Thank you for considering contributing.

License
-------

[](#license)

The project is open-sourced software licensed under the MIT license.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

1907d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ede1c1348096fc4b8036e247f879ef62cd7713ffebfc97cf6cbd1e5b40b1f19?d=identicon)[splendour](/maintainers/splendour)

---

Top Contributors

[![gduymaz](https://avatars.githubusercontent.com/u/8122090?v=4)](https://github.com/gduymaz "gduymaz (4 commits)")

---

Tags

wordsnumberstonumber to text

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/splendour-number-to-text/health.svg)

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

###  Alternatives

[doctrine/inflector

PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.

11.4k855.8M711](/packages/doctrine-inflector)[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4235.0M21](/packages/kwn-number-to-words)[coduo/php-to-string

Simple library that converts PHP value into strings

27112.7M10](/packages/coduo-php-to-string)[vanderlee/syllable

Text syllable splitting and hyphenation using Frank M. Liang's TeX algorithm.

124432.6k8](/packages/vanderlee-syllable)[kartik-v/yii2-field-range

Easily manage Yii 2 ActiveField ranges (from/to) with Bootstrap 3 addons markup and more

232.1M26](/packages/kartik-v-yii2-field-range)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35636.1k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

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