tiny-blocks/currency

Value Object representing a currency using ISO-4217 specifications.

2.2.0 2024-12-12 12:32 UTC

This package is auto-updated.

Last update: 2024-12-25 06:21:31 UTC


README

License

Overview

Value Object representing a currency using ISO-4217 specifications.

Installation

composer require tiny-blocks/currency

How to use

The library exposes a concrete implementation through the Currency enum. Besides, the alphabetic code, you can get the default amount fraction digits for the respective currency.

$currency = Currency::USD;

$currency->name;                # USD
$currency->value;               # USD
$currency->getFractionDigits(); # 2

License

Currency is licensed under MIT.

Contributing

Please follow the contributing guidelines to contribute to the project.