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

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

nwidart/money-formatter
=======================

A money formatting package.

1.0(11y ago)9889↓50%21MITPHPPHP &gt;=5.4.0

Since Mar 24Pushed 11y ago1 watchersCompare

[ Source](https://github.com/nWidart/MoneyFormatter)[ Packagist](https://packagist.org/packages/nwidart/money-formatter)[ Docs](https://github.com/nWidart/MoneyFormatter)[ RSS](/packages/nwidart-money-formatter/feed)WikiDiscussions master Synced 1mo ago

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

MoneyFormatter
==============

[](#moneyformatter)

[![Latest Version](https://camo.githubusercontent.com/fede9d048de966c508c1ee80af8f37c0caa538a0373e7bd453d51ee13c0cc40c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e7769646172742f4d6f6e6579466f726d61747465722e7376673f7374796c653d666c61742d737175617265)](https://github.com/nwidart/MoneyFormatter/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/0d0783823fa3be408b487aafb7a74aa75bfb575f2b450c05e276705b198007b1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e5769646172742f4d6f6e6579466f726d61747465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/nwidart/MoneyFormatter)[![Coverage Status](https://camo.githubusercontent.com/4a78e57bc257efecc37403bc6fc7b83d9648717d7428c7edbb63aa6b388bb453/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6e7769646172742f4d6f6e6579466f726d61747465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nwidart/MoneyFormatter/code-structure)[![Quality Score](https://camo.githubusercontent.com/a828d8b058a27062c7dc2c50065e6dbb3e89a52e9e07f06a0207b6d385a5c873/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6e7769646172742f4d6f6e6579466f726d61747465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/nwidart/MoneyFormatter)[![Total Downloads](https://camo.githubusercontent.com/a04c426413bc4258a6ff950d103d93b803045c39fa789c5d0602dd60edb48dd3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e7769646172742f6d6f6e65792d666f726d61747465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nwidart/money-formatter)

A simple package used for formatting a [`Money\Money`](https://github.com/mathiasverraes/money) value object.

Money is usually not stored as a float in your database, though your clients/users don't want to see `1000` meaning, 10. This package receives an amount in cents, and displays it according to the given locale with or with the currency symbol.

Want to use this inside a Laravel application? Check out the [MoneyFormatter-Laravel](https://github.com/nWidart/MoneyFormatter-Laravel) package.

Install
-------

[](#install)

Via Composer

```
$ composer require nwidart/money-formatter
```

Usage
-----

[](#usage)

To format money in **cents**:

```
$formatter = new MoneyFormatter('en_US');
$formattedMoney = $formatter->format(new Money(1000, new Currency('USD')));
# output : $10.00
```

Sometimes you may wish to not have the currency symbol, this can be done like so:

```
$formatter = new MoneyFormatter('en_US');
$formattedMoney = $formatter->formatWithoutCurrency(new Money(1000, new Currency('USD')));
# output : 10.00
```

This can be useful if your currency selection is a separate dropdown, for instance.

Testing
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Nicolas Widart](https://github.com/nWidart)
- [Philip Brown](https://github.com/philipbrown) for the inspiration from his Basket package. Decided to extract the MoneyFormatter class to a dedicated package.
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

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

4073d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/565946b8d70f5fa172a21f87b7f0e3abdce0611cc1cd300ec8e7b360bdb0a4bc?d=identicon)[nWidart](/maintainers/nWidart)

---

Top Contributors

[![nWidart](https://avatars.githubusercontent.com/u/882397?v=4)](https://github.com/nWidart "nWidart (26 commits)")

---

Tags

formattermoneyValue ObjectMoneyFormatter

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[moneyphp/money

PHP implementation of Fowler's Money pattern

4.8k82.5M422](/packages/moneyphp-money)[brick/money

Money and currency library

1.9k37.9M102](/packages/brick-money)[florianv/swap

Exchange rates library for PHP

1.3k6.4M16](/packages/florianv-swap)[cknow/laravel-money

Laravel Money

1.0k4.3M22](/packages/cknow-laravel-money)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4235.0M21](/packages/kwn-number-to-words)

PHPackages © 2026

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