PHPackages                             tentwofour/formatter - 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. tentwofour/formatter

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

tentwofour/formatter
====================

Provides formatters for phone numbers, postal codes, etc.

1.1.3(4y ago)01.5k2MITPHPPHP ^7.0|^8.0CI failing

Since Jul 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/tentwofour/formatter)[ Packagist](https://packagist.org/packages/tentwofour/formatter)[ Docs](https://github.com/tentwofour/formatter)[ RSS](/packages/tentwofour-formatter/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (7)Used By (2)

Formatter Component
===================

[](#formatter-component)

MoneyFormatter
--------------

[](#moneyformatter)

Formats from cents =&gt; dollars, and vice-versa. Useful for database storage of monetary values, without needing a decimal column.

*PHP's Type Juggling deals with string arguments, which may lead to unexpected results.*

```
MoneyFormatter::dollarsToCents(12.00);
// => 1200

MoneyFormatter::dollarsToCents(1200);
// => 12.00
```

PhoneNumberFormatter
--------------------

[](#phonenumberformatter)

Formats a phone number to a flattened string (eg. no separators of any kind), and back to a human-readable style again.

Current human-readable formats are N/A style (+%d (%d) %d-%d).

Useful for normalizing database stored values and allowing application-varied formatting.

```
$f = new PhoneNumberFormatter('+14239170989');

$formatted = $f->format()
// => +1 (423) 917-0989

$f->setPhoneNumber($formatted);
$reverse = $f->reverseFormat();
// => +14239170989
```

PostalCodeFormatter
-------------------

[](#postalcodeformatter)

Formats a postal code to a flattened representation, and back again. Supports US &amp; Canadian postal codes.

Useful for normalizing database stored values and allowing application-varied formatting.

```
$f = new PostalCodeFormatter('H0H 0H0');

$formatted = $f->format()
// => h0h0h0

$f->setPostalCode($formatted);
$reverse = $f->reverseFormat();
// => H0H 0H0
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity72

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

Recently: every ~443 days

Total

6

Last Release

1621d ago

PHP version history (4 changes)1.0.0PHP &gt;=5.3.3

1.0.1PHP ~5.6|~7.0

1.1.0PHP ^7.0

1.1.3PHP ^7.0|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4117615?v=4)[Blair D. Patterson](/maintainers/tentwofour)[@tentwofour](https://github.com/tentwofour)

---

Top Contributors

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

---

Tags

ten24tentwofourdata-transformations

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tentwofour-formatter/health.svg)

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

PHPackages © 2026

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