tiny-blocks/currency

Value Object representing a currency using ISO-4217 specifications.

2.1.0 2024-10-04 13:18 UTC

This package is auto-updated.

Last update: 2024-11-05 15:21:44 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.