tiny-blocks / currency
Value Object representing a currency using ISO-4217 specifications.
Installs: 8 478
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: ^8.1||^8.2
Requires (Dev)
- infection/infection: ^0.26
- phpmd/phpmd: ^2.13
- phpunit/phpunit: ^9.6
- squizlabs/php_codesniffer: ^3.7
README
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.