PHPackages                             lusitanian/phpmoney - 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. lusitanian/phpmoney

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

lusitanian/phpmoney
===================

PHP Money Pattern Implementation

124.8k3[1 issues](https://github.com/Lusitanian/PHPMoney/issues)PHP

Since Jan 27Pushed 13y ago3 watchersCompare

[ Source](https://github.com/Lusitanian/PHPMoney)[ Packagist](https://packagist.org/packages/lusitanian/phpmoney)[ RSS](/packages/lusitanian-phpmoney/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHPMoney
========

[](#phpmoney)

PHPMoney is a unit-tested Money pattern implementation (sans currency -- which is on the TODO list) for PHP 5.3+

Installation (composer)
-----------------------

[](#installation-composer)

Add the following item to your `composer.json`'s require section: `"lusitanian/phpmoney": "dev-master"`

Usage
-----

[](#usage)

The classes are set up in a PSR-0 compliant manner and will work with any PSR-0 autoloader if you don't install the package with composer (which generates an autoloader automatically). The library includes a `MoneyFactory` that will create `Money` instances for you using the best-available `MathProvider` that will work on your installation of PHP.

**Example Usage**

```
