phpuef / currency
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:template
Requires (Dev)
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^12.1
This package is auto-updated.
Last update: 2025-05-19 01:17:06 UTC
README
Currency
The currency
package provides functionality to manage and validate different currency codes and their details. It contains a list of currency codes with information such as the name, symbol, and minor units (decimal places). You can use this package to retrieve currency information and validate whether a currency code exists. (ISO 4217)
Versions
Also available in other languages
Features
- Search for a currency by its code (e.g., USD, EUR).
- Validate if a currency code exists.
- Return detailed information such as currency name, symbol, and minor units.
Installation
composer require gouef/currency
Usages
Finding a currency
You can use the FindCurrency
function to search for a currency by its code. It returns a pointer to the Currency
object, which contains details like the name, symbol, and minor units.
<?php use Phpuef\Currency\Currencies; class Example { public function get(string $code) { $currency = Currencies::FindCurrency($code); // } }
Validating a Currency Code
To check whether a currency code is valid, use the ValidateCurrency
function. It returns true
if the code exists and false
otherwise.
<?php use Phpuef\Currency\Currencies; class Example { public function validate(string $code): bool { return Currencies::ValidateCurrency($code); } }
Contributing
Read Contributing
Contributors
Join our Discord Community! 🎉
Click above to join our community on Discord!