PHPackages                             tiny-blocks/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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. tiny-blocks/currency

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

tiny-blocks/currency
====================

Models ISO-4217 currencies as a PHP enum, with per-currency fraction digit resolution.

2.3.2(1mo ago)422.5k↓74.1%1MITPHPPHP ^8.5CI passing

Since Jul 25Pushed 1mo agoCompare

[ Source](https://github.com/tiny-blocks/currency)[ Packagist](https://packagist.org/packages/tiny-blocks/currency)[ Docs](https://github.com/tiny-blocks/currency)[ RSS](/packages/tiny-blocks-currency/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (9)Dependencies (9)Versions (10)Used By (1)

Currency
========

[](#currency)

[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://github.com/tiny-blocks/currency/blob/main/LICENSE)

- [Overview](#overview)
- [Installation](#installation)
- [How to use](#how-to-use)
- [License](#license)
- [Contributing](#contributing)

Overview
--------

[](#overview)

Models [ISO-4217](https://www.iso.org/iso-4217-currency-codes.html) currencies as a PHP enum, covering all standard currency codes with their correct number of fraction digits. Resolves edge cases such as zero-decimal currencies (JPY, KRW), three-decimal currencies (BHD, KWD), and four-decimal currencies (CLF, UYW). Backed by a native PHP enum for zero-overhead comparison and type safety.

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

[](#installation)

```
composer require tiny-blocks/currency
```

How to use
----------

[](#how-to-use)

The library exposes the `Currency` enum. In addition to the alphabetic code, the matching number of fraction digits is available for the respective currency.

```
