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

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

gnahotelsolutions/currency-converter
====================================

Convert price amounts between currencies

v1.0.1(1y ago)4471MITPHPPHP ^8.0CI failing

Since Oct 3Pushed 1y ago5 watchersCompare

[ Source](https://github.com/gnahotelsolutions/currency-converter)[ Packagist](https://packagist.org/packages/gnahotelsolutions/currency-converter)[ Docs](https://github.com/gnahotelsolutions/currency-converter)[ RSS](/packages/gnahotelsolutions-currency-converter/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Convert price amounts between currencies
========================================

[](#convert-price-amounts-between-currencies)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6d32cd07cf27223f13c1ce2ba8f877751f176662289c9a4a575102557b3f5a5f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676e61686f74656c736f6c7574696f6e732f63757272656e63792d636f6e7665727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gnahotelsolutions/currency-converter)[![Build status](https://github.com/gnahotelsolutions/currency-converter/actions/workflows/php.yml/badge.svg)](https://github.com/gnahotelsolutions/currency-converter/actions/workflows/php.yml/badge.svg)[![Quality Score](https://camo.githubusercontent.com/ed0c6d75344f5b65b2660e113f916996b290989a39f5392ecaa7b1394f34343a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f676e61686f74656c736f6c7574696f6e732f63757272656e63792d636f6e7665727465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gnahotelsolutions/currency-converter)[![Total Downloads](https://camo.githubusercontent.com/dd9eb3f9a96a0a518d6be2b5d70c85b013b9073996a3f39e2ff8c85839fa6354/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676e61686f74656c736f6c7574696f6e732f63757272656e63792d636f6e7665727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gnahotelsolutions/currency-converter)

Use this package to convert prices from one currency to another by the exchange rate using a base currency.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require gnahotelsolutions/currency-converter
```

Usage
-----

[](#usage)

Before anything, you need to create a repository of currencies to be loaded into the `Converter`.

A currency needs a `name`, `exchange rate` and `decimals` to be shown after the conversion.

```
$repository = new CurrenciesRepository([
    new Currency('EUR', 1, 2),
    new Currency('USD', 1.1, 2),
    // ...
]);
```

When declaring a `Converter`, you'll also have to tell what's your base currency from where the exchange rates are calculated.

```
$baseCurrency = new Currency('EUR', 1, 2);

$converter = new Converter($baseCurrency, $repository);
```

Once your `Converter` is ready, you can transform a `Price` using the fluent interface. The result will be a new `Price` instance with the converted amount and the desired currency

```
$price = new Price(1000, 'EUR');

$converter->from($price)->to('USD')->convert(); // new Price(1100, 'USD')
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [GNA Hotel Solutions](https://github.com/gnahotelsolutions)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 69.2% 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 ~1834 days

Total

2

Last Release

624d ago

PHP version history (2 changes)v1.0PHP ^7.1

v1.0.1PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5665466?v=4)[David Llop](/maintainers/lloople)[@Lloople](https://github.com/Lloople)

---

Top Contributors

[![Lloople](https://avatars.githubusercontent.com/u/5665466?v=4)](https://github.com/Lloople "Lloople (9 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (3 commits)")[![adriacanal](https://avatars.githubusercontent.com/u/5726514?v=4)](https://github.com/adriacanal "adriacanal (1 commits)")

---

Tags

convert-pricescurrenciesexchange-ratehacktoberfestphpcurrency-convertergnahotelsolutions

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ujjwal/currency-converter

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

49228.8k](/packages/ujjwal-currency-converter)[gnahotelsolutions/laravel-trailing-slash

End your Laravel project routes with trailing slash

113.5k](/packages/gnahotelsolutions-laravel-trailing-slash)

PHPackages © 2026

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