tiny-blocks / currency
Value Object representing a currency using ISO-4217 specifications.
Installs: 21 821
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/tiny-blocks/currency
Requires
- php: ^8.5
Requires (Dev)
- infection/infection: ^0.32
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- squizlabs/php_codesniffer: ^4.0
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.