Skip to content

tiny-blocks/currency

Repository files navigation

Currency

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.