PHPackages                             levizwannah/php-nums-to-letters - 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. levizwannah/php-nums-to-letters

ActiveLibrary

levizwannah/php-nums-to-letters
===============================

Convert Numbers to Order Letters. For example 0 =&gt; A, 1 =&gt; B

v1.0.0(2y ago)12.8k↑50%MITPHPCI failing

Since Oct 4Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/levizwannah/php-nums-to-letters)[ Packagist](https://packagist.org/packages/levizwannah/php-nums-to-letters)[ RSS](/packages/levizwannah-php-nums-to-letters/feed)WikiDiscussions main Synced 1mo ago

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

[![Installs](https://camo.githubusercontent.com/bf13ec9e3f3a4efd864a13662981329ca74ffc35e4bb85b1a3afe659eb1278f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6576697a77616e6e61682f7068702d6e756d732d746f2d6c657474657273)](https://camo.githubusercontent.com/bf13ec9e3f3a4efd864a13662981329ca74ffc35e4bb85b1a3afe659eb1278f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6576697a77616e6e61682f7068702d6e756d732d746f2d6c657474657273) [![Deployment tests](https://github.com/levizwannah/php-nums-to-letters/actions/workflows/php.yml/badge.svg)](https://github.com/levizwannah/php-nums-to-letters/actions/workflows/php.yml/badge.svg) [![Development tests](https://github.com/levizwannah/php-nums-to-letters/actions/workflows/develop-php.yml/badge.svg?branch=develop)](https://github.com/levizwannah/php-nums-to-letters/actions/workflows/develop-php.yml/badge.svg?branch=develop)

PHP Numbers To Letter
=====================

[](#php-numbers-to-letter)

This Library converts Integers to Letters using A-Z. 0 = A, 25 = Z, using that, we can convert any integer to a letter format.

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

[](#installation)

Install using composer

```
composer require levizwannah/php-nums-to-letters
```

Methods
-------

[](#methods)

### toLetters($numbers)

[](#tolettersnumbers)

Converts numbers to Letter format (Capital letters only);

```
use LeviZwannah\PhpNumsToLetters\Converter;

$letters = Converter::toLetters(12345);
```

### toNumber($letters)

[](#tonumberletters)

Converts letters to number format. The letters will be converted to uppercase first.

```
use LeviZwannah\PhpNumsToLetters\Converter;

$number = Converter::toNumber('AABC');
```

### isEqual($val1, $val2)

[](#isequalval1-val2)

This method tries to efficiently compares $val1 and $val2. Either of them can be string|integers. The comparison will still work.

```
use LeviZwannah\PhpNumsToLetters\Converter;

Converter::isEqual(1, 'B'); // true
Converter::isEqual(1, 1); // true;
Converter::isEqual('B', 'B'); // true;
Converter::isEqual(0, 'B'); // false
Converter::isEqual('dw', 'DW'); // true
```

Note
----

[](#note)

### Capital Letters only

[](#capital-letters-only)

Only Capital letters are used. Not lowercase so that we don't have any confusion. Imagine an Invoice number being AaBbC. That doesn't look good.

### Sign Numbers

[](#sign-numbers)

When the number has a negative sign, the sign will be preserved in the conversion. For example, -1 = -B and -C = -2.

### Decimal

[](#decimal)

Only Integers are supported at the moment because 1/26 gives a very long decimal.

Do the Math
-----------

[](#do-the-math)

With only 7 Letters, you can represent -8,031,810,176 to 8,031,810,176 numbers.

Use cases
---------

[](#use-cases)

1. Beautiful Order Invoice Numbers from Order IDS or some random Number.
2. Representing IDs

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance53

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

951d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/56189552?v=4)[Levi Kamara Zwannah](/maintainers/levizwannah)[@levizwannah](https://github.com/levizwannah)

---

Top Contributors

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

---

Tags

convert-numbers-to-letters-phpphpphp-numbers-to-letters

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/levizwannah-php-nums-to-letters/health.svg)

```
[![Health](https://phpackages.com/badges/levizwannah-php-nums-to-letters/health.svg)](https://phpackages.com/packages/levizwannah-php-nums-to-letters)
```

PHPackages © 2026

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