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

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

antonienko/money-formatter
==========================

Formatter for moneyphp/money library using alcohol/iso4217 for obtaining the number of decimal digits in each currency

v2.0(10y ago)43.9k2MITPHPPHP &gt;=5.4

Since Jul 21Pushed 10y agoCompare

[ Source](https://github.com/antonienko/MoneyFormatter)[ Packagist](https://packagist.org/packages/antonienko/money-formatter)[ Docs](http://www.antoniohs.com/2016/03/03/antonienkomoneyformatter-2-0/)[ RSS](/packages/antonienko-money-formatter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (8)Used By (0)

Money Formatter
===============

[](#money-formatter)

[![Run Status](https://camo.githubusercontent.com/98b86de9dac582341e9c532780d74c157d31ccf54d4e51d7cd7db6b8f1402645/68747470733a2f2f6170692e736869707061626c652e636f6d2f70726f6a656374732f3535613532333332656464376632633035323663393235632f62616467653f6272616e63683d6d6173746572)](https://app.shippable.com/projects/55a52332edd7f2c0526c925c)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5473079e3f39acafd11f7bbef41abe339cffeb37e7312eaed1323f4741a78b79/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e746f6e69656e6b6f2f4d6f6e6579466f726d61747465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/antonienko/MoneyFormatter/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/379c637e7e3a4db734f09364f316417856d669303a4e5d12d4352682a1d91ba4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e746f6e69656e6b6f2f4d6f6e6579466f726d61747465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/antonienko/MoneyFormatter/?branch=master)[![Build Status](https://camo.githubusercontent.com/a70f004ba45c67f7e7151a22b500ddf225347001f7ac439a8422cacf139da891/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e746f6e69656e6b6f2f4d6f6e6579466f726d61747465722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/antonienko/MoneyFormatter/build-status/master)

Class to convert [Moneyphp/money objects](https://github.com/moneyphp/money) to the base unit representation of the given currency (float) or to a string representation given a locale, using [php's intl extension](http://php.net/manual/en/numberformatter.formatcurrency.php).

To do so it leverages the info provided by the [iso4217 library from Alcohol](https://github.com/alcohol/iso4217) in order to know the exact number of decimal places that each currency uses.

\##Installation ###Composer This library is available in packagist.org, you can add it to your project via Composer.

In the "require" section of your composer.json file:

Always up to date (bleeding edge, API *not* guaranteed stable)

```
"antonienko/money-formatter": "dev-master"
```

Specific minor version, API stability

```
"antonienko/money-formatter": "2.0.*"
```

Features
--------

[](#features)

- Convert a ***Money Object to float value***, depending on the number of decimal places used by the currency.
- Convert a ***Money Object to string***, formatted using the provided locale.
- Get the ***currency symbol*** of a Money Object, either just the symbol or the full currency symbol (The "just the symbol" option for Canadian Dollar would be '$', but if you are in the USA you would need the "full symbol" option "CA$")
- Get the ***symbol position*** for a given locale (right or left position)

\##Sample Usage

```
use antonienko\MoneyFormatter\MoneyFormatter;
use Money\Currency;
use Money\Money;

$some_euros   = new Money(300005, new Currency('EUR'));
$some_dollars = new Money(300005, new Currency('USD'));
$mf = new MoneyFormatter('fr_FR');

$amount = $mf->toFloat($some_euros); //$amount will be (float)3000.05

$french_formatted = $mf->toString($some_euros); //$french_formatted will be '3 000,05 €'

$just_symbol = $mf->toSymbol($some_dollars); //$just_symbol would be '$'

$full_symbol = $mf->toSymbol($some_dollars, false); //$full_symbol would be '$US'

$position = $mf->getSymbolPosition($some_euros); //position would be MoneyFormatter::SYMBOL_POSITION_RIGHT
```

\##License Information Licensed under **The MIT License (MIT)**. See the LICENSE file for more details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% 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 ~37 days

Recently: every ~18 days

Total

7

Last Release

3727d ago

Major Versions

v1.4 → v2.02016-03-04

PHP version history (3 changes)v1.0PHP &gt;=5.3.3

v1.3.1PHP &gt;=5.3

v2.0PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fcdc6571b70b8819f1b8b419f4acf0e4117942d456414e85dfe574917ab3ac4?d=identicon)[antonienko](/maintainers/antonienko)

---

Top Contributors

[![rmrbest](https://avatars.githubusercontent.com/u/1328494?v=4)](https://github.com/rmrbest "rmrbest (13 commits)")[![jordicasadevall](https://avatars.githubusercontent.com/u/1006252?v=4)](https://github.com/jordicasadevall "jordicasadevall (1 commits)")

---

Tags

formattermoneycurrencyValue Object

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/antonienko-money-formatter/health.svg)](https://phpackages.com/packages/antonienko-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)
