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

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

hexcores/currency
=================

Currency converter library

0.0.5(6y ago)4862MITPHPPHP &gt;=5.3.0CI failing

Since Dec 15Pushed 6y ago5 watchersCompare

[ Source](https://github.com/hexcores/currency)[ Packagist](https://packagist.org/packages/hexcores/currency)[ Docs](https://github.com/hexcores/currency)[ RSS](/packages/hexcores-currency/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Hexcores Currency Package
=========================

[](#hexcores-currency-package)

Currency package is easy to use multiple currency value (format) at your application. (eg: E-Commerce)

[![Build Status](https://camo.githubusercontent.com/934560a1f181fc2487979f020ad9c2ebbf95c82f8e2e956ab8bb2fc9652429ae/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f686578636f7265732f63757272656e63792e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/hexcores/currency)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://raw.githubusercontent.com/hexcores/currency/master/LICENSE)

Package Dependencies
--------------------

[](#package-dependencies)

- "php": "&gt;=5.3.0"

### Exchange Services

[](#exchange-services)

- (CentralBankMyanmarExchange) [Excahange rate from Cental Bank of Myanmar API](http://forex.cbm.gov.mm/index.php/api).

### Formatter Services

[](#formatter-services)

- BaseFormatter

Supported Currency Types
------------------------

[](#supported-currency-types)

- AUD (Australian dollar)
- CNY (Chinese renminbi)
- EUR (European Euro)
- GBP (Pound Sterling)
- JPY (Japanese yen)
- MMK (Myanmar Kyats)
- SGD (Singapore Dollar)
- THB (Thai Baht)
- USD (US Dollar)

Install
-------

[](#install)

You can install currency package from [composer](https://packagist.org/packages/hexcores/currency)

```
{
    "require": {
        "hexcores/currency": "dev-master"
    }
}
```

Usage
-----

[](#usage)

```
	use Hexcores\Currency\Type;
	use Hexcores\Currency\Converter;
	use Hexcores\Currency\Http\Client;
	use Hexcores\Currency\Formatter\BaseFormatter;
	use Hexcores\Currency\Exchange\CentralBankMyanmarExchange;

	$ex = new CentralBankMyanmarExchange(new Client());
	$f = new BaseFormatter();
	$converter = new Converter($ex, $f);

	echo "Convert : ". $converter->convert(2500, Type::USD, Type::MMK);
	echo "Convert AUD: ". $converter->convert(2500, Type::USD, Type::AUD);
```

#### Use central bank exchange with factory

[](#use-central-bank-exchange-with-factory)

```
	use Hexcores\Currency\Type;
	use Hexcores\Currency\Factory;

	$converter = Factory::centralBank();

	echo "Convert : ". $converter->convert(2500, Type::USD, Type::MMK);
	echo "Convert AUD: ". $converter->convert(2500, Type::USD, Type::AUD);
```

Example
-------

[](#example)

You can run example.php file from example folder.

Testing
-------

[](#testing)

```
$ phpunit
```

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

[](#contributing)

TODO

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~490 days

Total

5

Last Release

2256d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29fb608c623105faf35af0f3e476475691ae2ae377c55f1ae62fae9e959a8848?d=identicon)[nyanlynnhtut](/maintainers/nyanlynnhtut)

![](https://avatars.githubusercontent.com/u/8697585?v=4)[Hexcores](/maintainers/hexcores)[@hexcores](https://github.com/hexcores)

---

Top Contributors

[![nyanlynnhtut](https://avatars.githubusercontent.com/u/1456363?v=4)](https://github.com/nyanlynnhtut "nyanlynnhtut (16 commits)")

---

Tags

currencyconverterexchange

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ujjwal/currency-converter

Currency Converter Class with features of caching and identifying currency from country Code

49230.5k](/packages/ujjwal-currency-converter)

PHPackages © 2026

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