PHPackages                             martinjoiner/ordinal-number - 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. martinjoiner/ordinal-number

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

martinjoiner/ordinal-number
===========================

Converts numbers to a human readable ordinal form eg. 'first', 'second' or even 'Three thousand five hundred sixty first'

v1.0.0(9y ago)210.7k↓56.5%1MITPHPPHP &gt;=5.3.0

Since Feb 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/martinjoiner/ordinal-number)[ Packagist](https://packagist.org/packages/martinjoiner/ordinal-number)[ RSS](/packages/martinjoiner-ordinal-number/feed)WikiDiscussions master Synced 1mo ago

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

Ordinal Number
==============

[](#ordinal-number)

A PHP package for converting numbers to a human readable sentence of it's ordinal form eg. *'first'*, *'second'* or even *'Three thousand five hundred and sixty first'*

Latest release supports numbers in the range 1 - 9999.

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

[](#installation)

Recomended installation via Composer:

```
	composer require martinjoiner/ordinal-number

```

See library page on Packagist

Usage example
-------------

[](#usage-example)

```
	// Tell our code to use the namespace
	use MartinJoiner\OrdinalNumber\OrdinalNumber;

	// The following line will output 'three hundred seventy eighth'
	print OrdinalNumber::convert( 378 );

	// The following line will output 'three hundred and seventy eighth'
	print OrdinalNumber::convert( 378, true );

	// The following line will output 'Three hundred and seventy eighth' (notice capitalised)
	print OrdinalNumber::convert( 378, true, true );
```

convert() method parameters
---------------------------

[](#convert-method-parameters)

### Required parameters

[](#required-parameters)

- num {integer} A number to be converted (in the range of 1 - 9999)

### Optional parameters

[](#optional-parameters)

- appendAnd {boolean} - Default: *false* - Places the word 'and' before the final 2 parts if number above 101 or higher (eg. One hundred and first). Added to support both American and European versions of English language.
- titleCase {boolean} - Default: *false* - Capitalises the first letter

To see some working examples simply run index.php

Testing
-------

[](#testing)

Tests are written in PHPUnit

```
    phpunit --bootstrap vendor/autoload.php tests/OrdinalNumberTest

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~105 days

Total

4

Last Release

3431d ago

Major Versions

0.3.0 → v1.0.02016-12-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/8720096108cba90002969cf4d200acbf9665188c3bb5c49aa78ba5ca29316097?d=identicon)[martinjoiner](/maintainers/martinjoiner)

---

Top Contributors

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

---

Tags

englishnumberordinal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/martinjoiner-ordinal-number/health.svg)

```
[![Health](https://phpackages.com/badges/martinjoiner-ordinal-number/health.svg)](https://phpackages.com/packages/martinjoiner-ordinal-number)
```

###  Alternatives

[wapmorgan/morphos

A morphological solution for Russian and English language written completely in PHP. Provides classes to inflect personal names, geographical names, decline and pluralize nouns, generate cardinal and ordinal numerals, spell out money amounts and time.

8351.3M7](/packages/wapmorgan-morphos)[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)[php-decimal/php-decimal

Correctly-rounded arbitrary precision decimal floating point

781.0M9](/packages/php-decimal-php-decimal)[hnhdigital-os/laravel-number-converter

Number to word, roman, ordinal converter

20163.3k2](/packages/hnhdigital-os-laravel-number-converter)[hekmatinasser/notowo

This Package helps developers change number to word for all language on Laravel freamwork PHP

32510.4k2](/packages/hekmatinasser-notowo)[fresh/transliteration

PHP library for transliteration.

52135.6k1](/packages/fresh-transliteration)

PHPackages © 2026

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