tiny-blocks/currency

Value Object representing a currency using ISO-4217 specifications.

2.0.1 2023-06-17 15:14 UTC

This package is auto-updated.

Last update: 2024-08-22 12:58:20 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->getDefaultFractionDigits(); # 2

License

Currency is licensed under MIT.

Contributing

Please follow the contributing guidelines to contribute to the project.