PHPackages                             keios/moneyright - 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. keios/moneyright

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

keios/moneyright
================

Precise, GAAP-compliant, database-friendly Money Value Object

v1.0.9(2y ago)2055.5k↓50%4[1 issues](https://github.com/keiosweb/moneyright/issues)1MITPHPPHP &gt;=5.4.0CI failing

Since Feb 8Pushed 2y ago3 watchersCompare

[ Source](https://github.com/keiosweb/moneyright)[ Packagist](https://packagist.org/packages/keios/moneyright)[ Docs](https://github.com/keios/moneyright)[ RSS](/packages/keios-moneyright/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (10)Used By (1)

Keios/MoneyRight
================

[](#keiosmoneyright)

[![Latest Version](https://camo.githubusercontent.com/087e3ecf49b091802530b57e09c71f7849956de045d31fd8744b75c4999216ce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6b65696f737765622f6d6f6e657972696768742e7376673f7374796c653d666c61742d737175617265)](https://github.com/keiosweb/moneyright/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/b802538e8ada6c9f9e57fa8afa0a61fad26e45ae6b90017684127c363b6d80f4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6b65696f737765622f6d6f6e657972696768742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/keiosweb/moneyright)[![Coverage Status](https://camo.githubusercontent.com/d86c16626a06e85866a3f5a33303da20eea8d9c90bcb33a0deaf2e4687cb0d3e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6b65696f737765622f6d6f6e657972696768742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/keiosweb/moneyright/code-structure)[![Quality Score](https://camo.githubusercontent.com/bc7161cd9e6e86c9594848ced61e029e3f9252ae77135a65035039a795f53f56/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6b65696f737765622f6d6f6e657972696768742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/keiosweb/moneyright)[![Total Downloads](https://camo.githubusercontent.com/8e7b54faf4e4a547d970792ada18a885d9dac2619e19a61ff6c31b366e4e9e4d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b65696f737765622f6d6f6e657972696768742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/keiosweb/moneyright)

Arbitrary precision arithmetic-based Money value object. Drop-in replacement for [Mathias Verraes'](https://github.com/mathiasverraes) Money library (some use statement tweaking required). Follows [GAAP](http://en.wikipedia.org/wiki/Generally_accepted_accounting_principles) suggestion to use 4 decimal places with rounding on 5th to minimize statistical influence of rounding errors.

Follows PSR-2 guidelines.

Project name is inspired by [Kanye West's](https://www.youtube.com/watch?v=E58qLXBfLrs) verse:

```
La la la la... wait till I get my money right!

```

As we all know money really should be right (and therefore not stored in floats!).

Requirements
------------

[](#requirements)

PHP 5.4.0+ BCMath Arbitrary Precision Arithmetic PHP extension

Install
-------

[](#install)

Via Composer

```
$ composer require keios/moneyright
```

Usage
-----

[](#usage)

```
$tenEuroNetPrice = Keios\MoneyRight\Money::EUR('10'); // Money::EUR(10000) integers as cents | Money::EUR(10.0) floats as literal amount

var_dump($tenEuroNetPrice->getAmount()); // int(1000) - cents
var_dump($tenEuroNetPrice->getAmountString()); // string(7) "10.0000" - literal amount in string with 4 decimal points precision

$vatTax = $tenEuroNetPrice->multiply('0.23'); // 23% VAT tax

var_dump(assert(!$vatTax->equals($tenEuroNetPrice))); // bool(true)
var_dump($vatTax->getAmountString()); // string(6) "2.3000"

$grossPrice = $tenEuroNetPrice->add($vatTax); // instances are immutable, so every operation returns new instance

var_dump($grossPrice->getAmountString()); // string(7) "12.3000"
var_dump($grossPrice->getAmount()); // int(1230) - cents
```

Testing
-------

[](#testing)

```
$ phpunit
```

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Keios Solutions](https://github.com/keiosweb)
- [Mathias Verraes](https://github.com/mathiasverraes)
- [RubyMoney](https://github.com/RubyMoney)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~455 days

Recently: every ~740 days

Total

8

Last Release

929d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/296396f9b0fca242c05ac714f5545e94cdaa3b95b5be1ccdd70ff534ff2b0b8e?d=identicon)[keiosweb](/maintainers/keiosweb)

---

Top Contributors

[![lbialy](https://avatars.githubusercontent.com/u/8607442?v=4)](https://github.com/lbialy "lbialy (24 commits)")[![keiosweb](https://avatars.githubusercontent.com/u/10880818?v=4)](https://github.com/keiosweb "keiosweb (5 commits)")[![bendavies](https://avatars.githubusercontent.com/u/625392?v=4)](https://github.com/bendavies "bendavies (1 commits)")[![fatganz](https://avatars.githubusercontent.com/u/304809?v=4)](https://github.com/fatganz "fatganz (1 commits)")[![mathop](https://avatars.githubusercontent.com/u/392130?v=4)](https://github.com/mathop "mathop (1 commits)")

---

Tags

moneymoneyrightGAAP

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/keios-moneyright/health.svg)

```
[![Health](https://phpackages.com/badges/keios-moneyright/health.svg)](https://phpackages.com/packages/keios-moneyright)
```

###  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)
