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

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

abivia/money
============

Library for working with monetary values, a BCMath library with rounding support.

1.2.0(2y ago)36971MITPHPPHP ^8.0|^8.1

Since Jun 24Pushed 2y ago2 watchersCompare

[ Source](https://github.com/abivia/money)[ Packagist](https://packagist.org/packages/abivia/money)[ RSS](/packages/abivia-money/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Abivia Money: BCMath with rounding for currency calculations
============================================================

[](#abivia-money-bcmath-with-rounding-for-currency-calculations)

Abivia Money is a compact, fluent library that implements correct rounding logic, with the option to fall back to BCMath's truncation mode. Money instances are immutable.

Money implements the BCMath functions essential for financial calculations, along with other useful functions `ceil`, `floor`, `max`, `min`, and `round`.

Money objects can retain individual scale values. If an operation is performed on two objects with different scale values, the result will retain the higher precision.

The Rounding Problem
--------------------

[](#the-rounding-problem)

Example: $35.04 / 1.15 = $30.469565217

When working with currencies there are no fractional cents. This should be rounded to 30.47. But

```
echo bcdiv('35.04', '1.15', 2);

30.46
```

That's a rounding error of .95 cents instead of 0.05 cents. Not a big deal for a dozen calculations but made a million times, that's a difference of $900,000.

```
use Abivia\Money;

Money::setScale(2);
echo Money::make('35.04')->div('1.15');

30.47
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% 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 ~205 days

Total

3

Last Release

1059d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/42cd72dce530e94e60853407cdab69ead232423272b482218ae686c740ce0e99?d=identicon)[abivia](/maintainers/abivia)

---

Top Contributors

[![instancezero](https://avatars.githubusercontent.com/u/2599327?v=4)](https://github.com/instancezero "instancezero (9 commits)")[![abivia](https://avatars.githubusercontent.com/u/94868022?v=4)](https://github.com/abivia "abivia (1 commits)")[![JaberWiki](https://avatars.githubusercontent.com/u/55241455?v=4)](https://github.com/JaberWiki "JaberWiki (1 commits)")

---

Tags

moneycurrencyAccountingabivia

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[brick/money

Money and currency library

1.9k41.8M153](/packages/brick-money)[florianv/swap

PHP currency conversion library for retrieving exchange rates from 30+ providers, with caching and fallback.

1.3k6.8M23](/packages/florianv-swap)[cknow/laravel-money

Laravel Money

1.0k4.8M30](/packages/cknow-laravel-money)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7865.8M46](/packages/akaunting-laravel-money)[kwn/number-to-words

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

4375.4M23](/packages/kwn-number-to-words)[torann/currency

This provides Laravel with currency functions such as currency formatting and conversion using up-to-date exchange rates.

4031.1M6](/packages/torann-currency)

PHPackages © 2026

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