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

Abandoned → [assimtech/fiat](/?search=assimtech%2Ffiat)Library[Utility &amp; Helpers](/categories/utility)

assimtech/money
===============

Money, Currency and Accounting

1.1.3(9y ago)04851MITPHPPHP &gt;=5.5.9

Since Jun 26Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (6)Used By (1)

Money
=====

[](#money)

[![Build Status](https://camo.githubusercontent.com/27c4ab6863ec8549406795d9aad129651a7470c518beaf2a602f36a9b43a8937/68747470733a2f2f7472617669732d63692e6f72672f617373696d746563682f6d6f6e65792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/assimtech/money)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8871feac6924c273fa7abf57d8e8d5ee2ef4819319c1231baf89eff06b7c750b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f617373696d746563682f6d6f6e65792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/assimtech/money/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/7c0753c2d50541981a49e9ebdc9deaabbe4f6fbb2d857dacd474efcdc4e8212d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f617373696d746563682f6d6f6e65792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/assimtech/money/?branch=master)

Provides models for representing Money and an Accountant performing arithmetic on Money without causing rounding errors

**THIS REPOSITORY HAS BEEN MOVED TO [Assimtech\\Fiat](https://github.com/assimtech/fiat)**

The last version of `Assimtech\Money` is `1.1.3`, `Assimtech\Fiat` follows on from `2.0.0`. The move is due to the naming of `Assimtech\Money\Money`.

The Models
----------

[](#the-models)

### Currency

[](#currency)

```
$usd = new Assimtech\Money\Currency('USD');
echo (string)$usd; // Outputs USD
echo $usd->getFractionDigits(); // Outputs 2

$jpy = new Assimtech\Money\Currency('JPY');
echo $jpy->getFractionDigits(); // Outputs 0

$iqd = new Assimtech\Money\Currency('IQD');
echo $iqd->getFractionDigits(); // Outputs 3
```

### Money

[](#money-1)

```
// assuming Locale is en-US
$money = new Money(pi(), $usd);
echo (string)$money; // Outputs 3.14 USD
echo $money->getFormattedAmount(); // Outputs 3.14
echo $money->getFormattedAmount('de-DE'); // Outputs 3,14
```

The Accountant
--------------

[](#the-accountant)

```
$accountant = new Assimtech\Money\Accountant();

$threeUSD = $accountant->add($oneUSD, $twoUSD);

$sixUSD = $accountant->subtract($tenUSD, $fourUSD);

$eightUSD = $accountant->multiply($fourUSD, 2);

$threeUSD = $accountant->divide($nineUSD, 3);

$sixUSD = $accountant->sum(array(
    $oneUSD,
    $twoUSD,
    $threeUSD,
));
```

Twig extension
--------------

[](#twig-extension)

The accountant is also exposed as a Twig extension

```
{{ add_money(money1, money2) }}

{{ subtract_money(money1, money2) }}

{{ multiply_money(money, fraction) }}

{{ divide_money(money, fraction) }}

{{ sum_money([ money1, money2, money3 ]) }}
```

Frameworks
----------

[](#frameworks)

Please see [MoneyBundle](https://github.com/assimtech/money-bundle) for integration with Symfony 2

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

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 ~120 days

Total

5

Last Release

3498d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3.3

1.1.2PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/44b37dfa4c70338da1f28fe48badad8d80cb0629e3dff8e7b758236ad942a27d?d=identicon)[kralos](/maintainers/kralos)

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[mapbender/mapbender

Mapbender library

10117.4k5](/packages/mapbender-mapbender)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

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