phpuef/currency
最新稳定版本:v1.1.0
Composer 安装命令:
composer require phpuef/currency
包简介
README 文档
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!
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-18
