PHPackages                             neuron-php/formatting - 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. neuron-php/formatting

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

neuron-php/formatting
=====================

Data formatters..

0.7.5(4mo ago)035.7k↓28.1%1MITPHPCI passing

Since Apr 23Pushed 4mo agoCompare

[ Source](https://github.com/Neuron-PHP/formatting)[ Packagist](https://packagist.org/packages/neuron-php/formatting)[ RSS](/packages/neuron-php-formatting/feed)WikiDiscussions develop Synced 1mo ago

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

[![CI](https://github.com/Neuron-PHP/formatting/actions/workflows/ci.yml/badge.svg)](https://github.com/Neuron-PHP/formatting/actions)[![codecov](https://camo.githubusercontent.com/0b265d2ffde549c2170d847a85d973a78ffe4a9173271994492aa8c74e2bad8c/68747470733a2f2f636f6465636f762e696f2f67682f4e6575726f6e2d5048502f666f726d617474696e672f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/Neuron-PHP/formatting)

Neuron-PHP Formatting
=====================

[](#neuron-php-formatting)

Overview
--------

[](#overview)

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

[](#installation)

Install php composer from

Install the neuron formatting component:

```
composer require neuron-php/formatting

```

Formatting
----------

[](#formatting)

### Currency

[](#currency)

Format a number as currency:

```
    $Formatter = new Currency();
    echo $Formatter->format( 5 );
```php
    $Formatter = new Currency();
    $Formatter->setPadLength( 6 );
    echo $Formatter->format( 5 );
```

Output:

```
$__5.00

```

Format a number as currency with a custom currency symbol, pad character and pad length:

```
    $Formatter = new Currency();
    $Formatter->setCurrencySymbol( "£" );
    $Formatter->setPadLength( 11 );
    $Formatter->setPadCharacter( '-' );
```

Output:

```
£-------5.00

```

### Date

[](#date)

Format a date:

```
    $Formatter = new Date();
    echo $Formatter->format( '12/23/2024' )
```

Output:

```
2024-12-23

```

Format a date with a custom format:

```
    $Formatter = new Date();
    $Formatter->setFormat( 'd/m/Y' );
    echo $Formatter->format( '12/23/2024' )
```

Output:

```
23/12/2024

```

### DateTime

[](#datetime)

Format a date and time:

```
    $Formatter = new DateTime();
    echo $Formatter->format( '12/23/2024 13:30' )
```

Output:

```
2024-12-24 1:30 pm

```

Format a date and time with a custom format:

```
    $Formatter = new DateTime();
    $Formatter->setFormat( 'd/m/Y H:i' );
    echo $Formatter->format( '12/23/2024 13:30' )
```

Output:

```
23/12/2024 13:30

```

### Time

[](#time)

Format a time:

```
    $Formatter = new Time();
    echo $Formatter->format( '13:30' )
```

Output

```
1:30 pm

```

Format a time with a custom format:

```
    $Formatter = new Time();
    $Formatter->setFormat( 'H:i:s' );
    $Formatter->format( '13:30:40' )
```

Output:

```
13:30:40

```

### PhoneNumber

[](#phonenumber)

Format a 10-digit phone number:

```
    $Formatter = new PhoneNumber();
    echo $Formatter->format( "1234567890" )
```

Output:

```
(123) 456-7890

```

Format a phone 7-digit phone number:

```
    $Formatter = new PhoneNumber();
    echo $Formatter->format( "1234567" )
```

Output:

```
123-4567

```

Format an international phone number:

```
    $Formatter = new PhoneNumber();
    echo $Formatter->format( "12345678901234567890" )
```

Output:

```
+12 34 567 89012

```

More Information
================

[](#more-information)

You can read more about the Neuron components at [neuronphp.com](http://neuronphp.com)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance77

Regular maintenance activity

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Every ~139 days

Recently: every ~16 days

Total

16

Last Release

125d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1099983?v=4)[Lee Jones](/maintainers/ljonesfl)[@ljonesfl](https://github.com/ljonesfl)

---

Top Contributors

[![ljonesfl](https://avatars.githubusercontent.com/u/1099983?v=4)](https://github.com/ljonesfl "ljonesfl (85 commits)")

---

Tags

data-formattingphp8

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/neuron-php-formatting/health.svg)

```
[![Health](https://phpackages.com/badges/neuron-php-formatting/health.svg)](https://phpackages.com/packages/neuron-php-formatting)
```

###  Alternatives

[milo/hydrator

Hydrates object from array, exports object to array

2571.9k](/packages/milo-hydrator)[logoscon/acf-plus

Common utility classes for the Advanced Custom Fields (Pro) plugin on WordPress.

1023.3k](/packages/logoscon-acf-plus)

PHPackages © 2026

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