Returns: string
- a full name of a currency United States dollar
.
Returns: string
- a short name of a currency dollar
.
Returns: string
- an ISO-code USD
.
Returns: string
- a numeric code 840
.
Parameters:
[?int $index = null]
(optional) - if there are more than one symbol (array of symbols), then you should pass an index of the array of symbols, otherwise the first one is taken.
Returns: string
- a symbol $
.
Returns: CurrencyPosition
Returns: CurrencyDisplay
$usd = currency("USD");
$usd->getFullName(); // "United States dollar"
$usd->getName(); // "dollar"
$usd->getCode(); // "USD"
$usd->getNumCode(); // "840"
$usd->getSymbol(); // "$"
$usd->getSymbols(); // ["$"]
$usd->getPosition(); // CurrencyPosition::Start
$usd->getDisplay(); // CurrencyDisplay::Symbol)
getSymbol()
takes an index as its first parameter only if there are more than one symbol for the currency.
use PostScripton\Money\Currency;
$currency = currency("EGP");
// ["£", "ج.م"]
$currency->getSymbol(); // "£"
$currency->getSymbol(1); // "ج.م"
See about choosing a preferred symbol for a currency with multiple symbols as well.
📌 Back to the contents.