PHPackages                             intelogie/numeral.php - 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. intelogie/numeral.php

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

intelogie/numeral.php
=====================

A PHP port of adamwdraper/Numeral-js

1.0.1(10y ago)0149MITPHPPHP &gt;=5.5.9

Since Feb 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/INTELOGIE/numeral.php)[ Packagist](https://packagist.org/packages/intelogie/numeral.php)[ RSS](/packages/intelogie-numeralphp/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Numeral.php
===========

[](#numeralphp)

[![Build Status](https://camo.githubusercontent.com/dd147bf61c9a75f2cd3f148b0fbcf7ba2a0932e8147a85eba04630c4f519039e/68747470733a2f2f7472617669732d63692e6f72672f5374696c6c61742f6e756d6572616c2e7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Stillat/numeral.php)[![Latest Stable Version](https://camo.githubusercontent.com/aebc3f16b241395827996bb91498b0d04d31e0bc87a55c65fc17e31fd90713ee/68747470733a2f2f706f7365722e707567782e6f72672f7374696c6c61742f6e756d6572616c2e7068702f762f737461626c65)](https://packagist.org/packages/stillat/numeral.php) [![Total Downloads](https://camo.githubusercontent.com/e25039b196f823d8d096666bcdad30a245aadcc5b3201cd998f1141a66b6a9d5/68747470733a2f2f706f7365722e707567782e6f72672f7374696c6c61742f6e756d6572616c2e7068702f646f776e6c6f616473)](https://packagist.org/packages/stillat/numeral.php) [![Latest Unstable Version](https://camo.githubusercontent.com/25a3572cde0472c3d03a0ebccce575b6ebd5769632cb1ebebd7d653316dedb5b/68747470733a2f2f706f7365722e707567782e6f72672f7374696c6c61742f6e756d6572616c2e7068702f762f756e737461626c65)](https://packagist.org/packages/stillat/numeral.php) [![License](https://camo.githubusercontent.com/b4d385ffda05f88a5ee8590ca4dfe546fb431986351c5bbfe66a9f097ba2de52/68747470733a2f2f706f7365722e707567782e6f72672f7374696c6c61742f6e756d6572616c2e7068702f6c6963656e7365)](https://packagist.org/packages/stillat/numeral.php)

Numeral.php is a number formatting library for PHP. It started off as a port of [`numerals-js`](http://numeraljs.com/) (a number formatting library for JavaScript). This is where Numeral.php gets it's name. The latest iteration of Numeral.php is based on [`numbro`](https://github.com/foretagsplatsen/numbro), a maintained "version" of numerals-js. The API is very similar to `numbro`, but there are some things that are different. Most of the documentation here is taken from the [`numbro.js website`](http://numbrojs.com/format.html), and adjusted where necessary, so be sure to give them some love.

Here is a quick example:

```
// +10,000
$formatter->format(1000.23, '+0,0');

// 233.43k
$formatter->format(233434, '0a.00');
```

Getting Started
---------------

[](#getting-started)

Working with Numeral.php is fairly straightforward. There are two things you have to do when first getting started. First, we need to create a language manager instance, and then a `Numeral` (this class does all the formatting and unformatting) instance. The language manager handles loading culture information that the formatter will use.

Doing this might look like this:

```
