Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2019-08-31 (11 days ago) | | Not yet rated by the users | | Total: 2 This week: 2 | | All time: 9,705 This week: 148 |
|
Description | | Author |
This class can get the symbol of any given currency.
It can take as parameter of code of a given currency.
The class can return the symbol associated to that currency. | |
|
Details
php currency-util
A simple library to lookup the currency symbol for a given currency code.
Installation
composer req terdia/currency-util
Usage
Get symbol from currency code
use Currency\Util\CurrencySymbolUtil;
CurrencySymbolUtil::getSymbol('GBP') //=> '£'
CurrencySymbolUtil::getSymbol('EUR') //=> '?'
CurrencySymbolUtil::getSymbol('USD') //=> '$'
CurrencySymbolUtil::getSymbol('NOT A VALID CODE') throw InvalidArgumentException
Get List of supported currency code
use Currency\Util\CurrencySymbolMapping;
var_dump(CurrencySymbolMapping::values())
// =>
[
"USD" => "$",
"GBP" => "£",
"EUR" => "?",
?
]
Tests
vendor/bin/phpunit tests
Contribution
Feel free to contribute to this library.
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.