tiny-blocks / currency
Value Object representing a currency using ISO-4217 specifications.
Installs: 21 485
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: ^8.3
Requires (Dev)
- infection/infection: ^0
- phpmd/phpmd: ^2.15
- phpstan/phpstan: ^1
- phpunit/phpunit: ^11
- squizlabs/php_codesniffer: ^3.11
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->getFractionDigits(); # 2
License
Currency is licensed under MIT.
Contributing
Please follow the contributing guidelines to contribute to the project.