PHPackages                             fortis/iso-currency - 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. fortis/iso-currency

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

fortis/iso-currency
===================

A PHP library providing ISO 4217 currencies. Work with currencies by the standard to avoid confusions.

1.0.1(8y ago)4165.7k↓14.8%6[2 PRs](https://github.com/fortis/iso-currency/pulls)2MITPHPPHP &gt;=5.6CI failing

Since Sep 10Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (6)Versions (3)Used By (2)

iso-currency
============

[](#iso-currency)

[![Travis](https://camo.githubusercontent.com/0f9b32cfc54aae64042303dc3b3e540353bce1533ccfe45f1505ef58818835c7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f666f727469732f69736f2d63757272656e63792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fortis/iso-currency)[![Coveralls](https://camo.githubusercontent.com/517e89a7bed1258d0fd6788601e0c54f7d5dde2bcf08400f1acd3f51cc23e310/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f666f727469732f69736f2d63757272656e63792f6d61737465722e737667)](https://coveralls.io/github/fortis/iso-currency?branch=master)[![Packagist](https://camo.githubusercontent.com/ff2d375559eba3b89a9f246cbb69013e98074ef0a8049ed13ad85f1ffeb01847/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666f727469732f69736f2d63757272656e63792e737667)](https://packagist.org/packages/fortis/iso-currency)[![FOSSA Status](https://camo.githubusercontent.com/e1de3b2cdd2b02fb2c610cdf7649aee3083b6d0bad0cc0ca69650413d4148ad0/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246666f7274697325324669736f2d63757272656e63792e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2Ffortis%2Fiso-currency?ref=badge_shield)

Very simple and easy-to-use `Currency` class to work with ISO 4217 currencies as they provided by the official ISO Maintenance Agency

What is ISO 4217
----------------

[](#what-is-iso-4217)

> ISO 4217 is a standard published by the International Organization for Standardization, which delineates currency designators, country codes (alpha and numeric), and references to minor units in three tables.
>
> *-- [Wikipedia](http://en.wikipedia.org/wiki/ISO_4217)*

Install
-------

[](#install)

Install directly from command line using Composer

```
composer require fortis/iso-currency
```

Use
---

[](#use)

Don't type currency codes as strings, instead it's better to use constants from auto generated CurrencyCode class as it's always up-to-date with currency-iso.org and helps you avoid typos. For example, use `CurrencyCode::USD` instead of `'USD'`. Autocomplete will make it easier.

Also you can create new currency object with Currency class and autocomplete: `new Currency::USD()`.

```
// Create Currency instance.
$currency = new Currency(CurrencyCode::EUR);     // constructor
$currency = Currency::create(CurrencyCode::EUR); // static factory method
$currency = Currency::EUR();                     // short syntax with autocomplete on ::

// Currency code validation.
$currency = new Currency('EUE'); // throws InvalidCurrencyException

// Check whether the given Currency is USD/EUR/etc.
$currency = new Currency(CurrencyCode::EUR);
$currency->is(Currency::EUR()); // true
$currency->is(Currency::USD()); // false
```

License
-------

[](#license)

iso-currency is licensed under the MIT license.

[![FOSSA Status](https://camo.githubusercontent.com/b81339f7df53c6eabaa4237e8e21f303ddefd263a8c159da96e370db95995c6f/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246666f7274697325324669736f2d63757272656e63792e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2Ffortis%2Fiso-currency?ref=badge_large)

Source(s)
---------

[](#sources)

- "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217)" by [Wikipedia](http://www.wikipedia.org) licensed under [CC BY-SA 3.0 Unported License](http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.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 ~1 days

Total

2

Last Release

3171d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/68e407bc3dc296bfb9d335a515f3318aa17c9d4c1446521591f36411e6000fb1?d=identicon)[fortis](/maintainers/fortis)

---

Top Contributors

[![fortis](https://avatars.githubusercontent.com/u/1042494?v=4)](https://github.com/fortis "fortis (91 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

bcmathcurrencycurrency-isogmpmoneymoneycurrencylibraryisocurrenciesISO 42174217iso-currency

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fortis-iso-currency/health.svg)

```
[![Health](https://phpackages.com/badges/fortis-iso-currency/health.svg)](https://phpackages.com/packages/fortis-iso-currency)
```

###  Alternatives

[payum/iso4217

ISO 4217 PHP Library

16312.1M5](/packages/payum-iso4217)[brick/money

Money and currency library

1.9k37.9M102](/packages/brick-money)[alcohol/iso4217

ISO 4217 PHP Library

15210.4M28](/packages/alcohol-iso4217)[league/iso3166

ISO 3166-1 PHP Library

70036.3M116](/packages/league-iso3166)[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)

PHPackages © 2026

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