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

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

phpuef/currency
===============

v1.1.0(11mo ago)21MITPHPCI passing

Since May 18Pushed 1mo ago1 watchersCompare

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

READMEChangelog (4)Dependencies (9)Versions (8)Used By (0)

[![](docs/gouef_logo.png)](docs/gouef_logo.png)

Currency
========

[](#currency)

The `currency` package provides functionality to manage and validate different currency codes and their details. It contains a list of currency codes with information such as the name, symbol, and minor units (decimal places). You can use this package to retrieve currency information and validate whether a currency code exists. ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217))

[![Static Badge](https://camo.githubusercontent.com/3d778317b299c7d2ffde3d918095cc96f51ce5d12b271ddd0141aced3fdd9ec6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769746875622d7068707565662532466769746875622d2d6c69622d2d74656d706c6174652d626c75653f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c696e6b3d6769746875622e636f6d25324670687075656625324663757272656e6379)](https://github.com/phpuef/currency)

[![Packagist Downloads](https://camo.githubusercontent.com/e919afea7a92eec56f6f8d66a074738aac8f3c6316d60e7d84cfcac332029946/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068707565662f63757272656e6379)](https://packagist.org/packages/phpuef/currency)[![GitHub stars](https://camo.githubusercontent.com/a470ae769fb4e5888201c6855b8eb756c363700d1beb2825048b9d10ed3fda22/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f7068707565662f63757272656e63793f7374796c653d736f6369616c)](https://github.com/phpuef/currency/stargazers)[![PHPStan](https://github.com/phpuef/currency/actions/workflows/phpstan.yml/badge.svg)](https://github.com/phpuef/currency/actions/workflows/phpstan.yml/badge.svg)[![Tests](https://github.com/phpuef/currency/actions/workflows/tests.yml/badge.svg)](https://github.com/phpuef/currency/actions/workflows/tests.yml)[![codecov](https://camo.githubusercontent.com/220a745856a0cd5a7be08633b05d4dda7801b6af493af96d938349823838105d/68747470733a2f2f636f6465636f762e696f2f6769746875622f7068707565662f63757272656e63792f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d59554738454d48365138)](https://codecov.io/github/phpuef/currency)

Versions
--------

[](#versions)

[![Stable Version](https://camo.githubusercontent.com/2896e8a939718df05dff041f207760c0f3bbf35cc27e3c7e047d16249cee360f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7068707565662f63757272656e63793f6c6162656c3d537461626c65266c6162656c436f6c6f723d677265656e)](https://camo.githubusercontent.com/2896e8a939718df05dff041f207760c0f3bbf35cc27e3c7e047d16249cee360f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7068707565662f63757272656e63793f6c6162656c3d537461626c65266c6162656c436f6c6f723d677265656e)[![GitHub Release](https://camo.githubusercontent.com/3eda7dfc629df2a03d57ca8bbf926cd70a3f43d41ed3cc3460dca7400ceaf70d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7068707565662f63757272656e63793f6c6162656c3d524326696e636c7564655f70726572656c65617365732666696c7465723d2a72632a266c6f676f53697a653d646961676f)](https://camo.githubusercontent.com/3eda7dfc629df2a03d57ca8bbf926cd70a3f43d41ed3cc3460dca7400ceaf70d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7068707565662f63757272656e63793f6c6162656c3d524326696e636c7564655f70726572656c65617365732666696c7465723d2a72632a266c6f676f53697a653d646961676f)[![GitHub Release](https://camo.githubusercontent.com/37f7100fcafb4d9915c4b499ade584540859c7e213dbbe85b37bbfdbdb715899/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7068707565662f63757272656e63793f6c6162656c3d4265746126696e636c7564655f70726572656c65617365732666696c7465723d2a626574612a266c6f676f53697a653d646961676f)](https://camo.githubusercontent.com/37f7100fcafb4d9915c4b499ade584540859c7e213dbbe85b37bbfdbdb715899/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7068707565662f63757272656e63793f6c6162656c3d4265746126696e636c7564655f70726572656c65617365732666696c7465723d2a626574612a266c6f676f53697a653d646961676f)

Also available in other languages
---------------------------------

[](#also-available-in-other-languages)

[![Go Implementation](https://camo.githubusercontent.com/8391e7af799c628abd3fbcf3c44286d3d7d16ca9297ad41168f219767fde8abf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476f2d63757272656e63792d3030414444383f6c6f676f3d476f266c6f676f436f6c6f723d7768697465)](https://github.com/gouef/currency)[![PHP Implementation](https://camo.githubusercontent.com/60cb2221c0ba3a4d98ad36f1b3d25b8353b3ef3ab74e9bf912d23ad9f0421cc6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d63757272656e63792d3446354439353f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://github.com/phpuef/currency)

Features
--------

[](#features)

- Search for a currency by its code (e.g., USD, EUR).
- Validate if a currency code exists.
- Return detailed information such as currency name, symbol, and minor units.

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

[](#installation)

```
composer require gouef/currency
```

Usages
------

[](#usages)

### Finding a currency

[](#finding-a-currency)

You can use the `FindCurrency` function to search for a currency by its code. It returns a pointer to the `Currency` object, which contains details like the name, symbol, and minor units.

```
