PHPackages                             nabeghe/shortnum - 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. nabeghe/shortnum

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

nabeghe/shortnum
================

Shortening numbers and using abbreviated letters in PHP.

v1.0.0(10mo ago)33MITPHPPHP &gt;=5.6

Since Oct 23Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/nabeghe/shortnum-php)[ Packagist](https://packagist.org/packages/nabeghe/shortnum)[ Docs](https://github.com/nabeghe/shortnum-php)[ RSS](/packages/nabeghe-shortnum/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Shortnum for PHP ≥ 5.6
======================

[](#shortnum-for-php--56)

> Shortening numbers and using abbreviated letters in PHP.

With Shortnum, you can easily display numbers like 1000 as 1K. Shortnum supports the following units:

`'K', 'M', 'B', 'T', 'Qa', 'Qi', 'Sx', 'Sp', 'Oc', 'No', 'Dc', 'Ud', 'Dd', 'Td', 'Qa', 'Qi', 'Sx', 'Sp', 'Oc', 'No'`

🫡 Usage
-------

[](#-usage)

### 🚀 Installation

[](#-installation)

You can install the package via composer:

```
composer require nabeghe/colory
```

#### Example:

[](#example)

```
use Nabeghe\Shortnum\Shortnum;

echo "1000 => ".Shortnum::short(1000)."\n"; // 1K
echo "1010 => ".Shortnum::short(1010)."\n"; // 1.01K
echo "1049 => ".Shortnum::short(1049)."\n"; // 1.05K
echo "1050 => ".Shortnum::short(1050)."\n"; // 1.05K
echo "1099 => ".Shortnum::short(1099)."\n"; // 1.1K
echo "1100 => ".Shortnum::short(1100)."\n"; // 1.1K
echo "10000 => ".Shortnum::short(10000)."\n"; // 10K
echo "10500 => ".Shortnum::short(10500)."\n"; // 10.5K
echo "15000 => ".Shortnum::short(15000)."\n"; // 15K
echo "100000 => ".Shortnum::short(100000)."\n"; // 100K
echo "1000000 => ".Shortnum::short(1000000)."\n"; // 1M
echo "1000000000 => ".Shortnum::short(1000000000)."\n"; // 1B
echo "1000000000 => ".Shortnum::short(1000000000)."\n"; // 1B
echo "1000000000000 => ".Shortnum::short(1000000000000)."\n"; // 1T
echo "1000000000000000 => ".Shortnum::short(1000000000000000)."\n"; // 1Qa
echo "1000000000000000000 => ".Shortnum::short(1000000000000000000)."\n"; // 1Qi
echo "1000000000000000000000 => ".Shortnum::short(1000000000000000000000)."\n"; // 1Sx
echo "1000000000000000000000000 => ".Shortnum::short(1000000000000000000000000)."\n"; // 1Sp
echo "1000000000000000000000000000 => ".Shortnum::short(1000000000000000000000000000)."\n"; // 1Oc
echo "1000000000000000000000000000000 => ".Shortnum::short(1000000000000000000000000000000)."\n"; // 1No
```

📖 License
---------

[](#-license)

Licensed under the MIT license, see [LICENSE.md](LICENSE.md) for details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance54

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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 ~253 days

Total

2

Last Release

319d ago

Major Versions

0.1.0 → v1.0.02025-07-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/dae1bf378bcf40fe55c193160377d613d628188587554a3fb11cdec6f0521ba1?d=identicon)[nabeghe](/maintainers/nabeghe)

---

Top Contributors

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

---

Tags

numberphpphp-libphp-librariesphp-libraryshort-numbersshortnumshortnumberhelperlibrarymathshortenersupportnumbersnumbershortnumber-abbreviationshortnumshort numshortnumbershort numbernumnumber shortenernumber shorthandnumerical notation

### Embed Badge

![Health badge](/badges/nabeghe-shortnum/health.svg)

```
[![Health](https://phpackages.com/badges/nabeghe-shortnum/health.svg)](https://phpackages.com/packages/nabeghe-shortnum)
```

PHPackages © 2026

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