tiny-blocks / currency
Value Object representing a currency using ISO-4217 specifications.
Installs: 19 256
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: ^8.2
Requires (Dev)
- infection/infection: ^0.29
- phpmd/phpmd: ^2.15
- phpstan/phpstan: ^1
- phpunit/phpunit: ^11
- squizlabs/php_codesniffer: ^3.10
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.