PHPackages                             assimtech/fiat - 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/fiat

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

assimtech/fiat
==============

Money, Currency and Accounting

3.1.1(5y ago)01.9k↓50%1MITPHPPHP &gt;=7.1

Since Jun 26Pushed 5mo ago1 watchersCompare

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

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

Fiat
====

[](#fiat)

[![Build Status](https://camo.githubusercontent.com/dd9e926acd04d2a856ce59ba6c4cdc93bb3f3f9d7e5b80ce59724749c0750227/68747470733a2f2f7472617669732d63692e6f72672f617373696d746563682f666961742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/assimtech/fiat)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ed14d6f3e72f4ea2e40fe8b8a01b1129ed21a7317c735f83d1b889ffd9a33975/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f617373696d746563682f666961742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/assimtech/fiat/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/281a94cc778e2545b1544b0ef94450aa5878bb1b646073238f5f83ac7dd636a2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f617373696d746563682f666961742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/assimtech/fiat/?branch=master)

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

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

[](#the-models)

### Currency

[](#currency)

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

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

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

### Money

[](#money)

```
// assuming Locale is en-US
$money = new Assimtech\Fiat\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\Fiat\Accountant();

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

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

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

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

$sixUSD = $accountant->sum([
    $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 [FiatBundle](https://github.com/assimtech/fiat-bundle) for integration with Symfony 4,5

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance50

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity65

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

Recently: every ~139 days

Total

11

Last Release

2037d ago

Major Versions

1.1.2 → 2.0.02016-10-19

2.0.2 → 3.0.02019-04-10

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

1.1.2PHP &gt;=5.5.9

2.0.2PHP &gt;=5.6

3.0.0PHP &gt;=7.1.3

3.1.0PHP &gt;=7.1

### Community

Maintainers

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

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

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