PHPackages                             olivers/twig-number-abbreviation-extension - 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. [Templating &amp; Views](/categories/templating)
4. /
5. olivers/twig-number-abbreviation-extension

ActiveLibrary[Templating &amp; Views](/categories/templating)

olivers/twig-number-abbreviation-extension
==========================================

Number abbreviation extension for twig. This extension helps you to display an easy-to-read format for your numbers.

v1.0.0(7y ago)41.8k↓50%1MITPHPPHP &gt;=7.0

Since Sep 7Pushed 4y agoCompare

[ Source](https://github.com/0l1v3r5/twig-number-abbreviation-extension)[ Packagist](https://packagist.org/packages/olivers/twig-number-abbreviation-extension)[ Docs](https://github.com/0l1v3r5/twig-number-abbreviation-extension)[ RSS](/packages/olivers-twig-number-abbreviation-extension/feed)WikiDiscussions master Synced 1mo ago

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

The Number abbreviation Extension
=================================

[](#the-number-abbreviation-extension)

This extension is inspired by the work of [Our Code World](https://ourcodeworld.com/articles/read/786/how-to-create-the-abbreviation-of-a-number-in-php). The Number abbreviation extension provides the following filters:

- `exact_abbr`
- `general_abbr`

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

[](#installation)

Using composer :

`composer require olivers/twig-number-abbreviation-extension`

Showing exact abbreviation of number
------------------------------------

[](#showing-exact-abbreviation-of-number)

Use the `exact_abbr` filter if you are willing to display exactly the abbreviation of the providen number. This means, displaying the abbreviation with decimals.

```
{{ "18298548"|exact_abbr }}

```

This example would output `18.5M`, as `18298548` is the providen number.

Showing general abbreviation of number
--------------------------------------

[](#showing-general-abbreviation-of-number)

Use the `general_abbr` filter if you are willing to display only the important part of the providen number (without exact group of thousand). Instead of generating an abbreviation with "decimals", the snippet will add the main number and a plus symbol.

```
{{ "18298548"|general_abbr }}

```

This example would output `18M+`, as `18298548` is the providen number.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

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

2805d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/597d4e2e5b5d6278d990ceee6848e3a39dc4feea252c3a590d881575c4ac2c0e?d=identicon)[0l1v3r5](/maintainers/0l1v3r5)

---

Top Contributors

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

---

Tags

numbernumber-abbreviationnumber-formattwigtwig-extensiontwigfilterextensionnumber-abbreviation

### Embed Badge

![Health badge](/badges/olivers-twig-number-abbreviation-extension/health.svg)

```
[![Health](https://phpackages.com/badges/olivers-twig-number-abbreviation-extension/health.svg)](https://phpackages.com/packages/olivers-twig-number-abbreviation-extension)
```

###  Alternatives

[redant/twig-components

Define reusable components in Twig.

3819.8k1](/packages/redant-twig-components)[gecko-packages/gecko-twig

Additional Twig filters and tests.

1113.0k](/packages/gecko-packages-gecko-twig)

PHPackages © 2026

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