Currency
Represents a currency.
- Full name:
\CommerceGuys\Intl\Currency\Currency
- This class is marked as final and can't be subclassed
- This class is a Final class
Properties
currencyCode
The alphanumeric currency code.
name
The currency name.
numericCode
The numeric currency code.
symbol
The currency symbol.
fractionDigits
The number of fraction digits.
locale
The locale (i.e. "en_US").
Methods
__construct
Creates a new Currency instance.
Parameters:
Parameter | Type | Description |
---|---|---|
$definition |
array | The definition array. |
__toString
Gets the string representation of the currency.
getCurrencyCode
Gets the alphabetic currency code.
getName
Gets the currency name.
This value is locale specific.
getNumericCode
Gets the numeric currency code.
The numeric code has three digits, and the first one can be a zero, hence the need to pass it around as a string.
getSymbol
Gets the currency symbol.
This value is locale specific.
getFractionDigits
Gets the number of fraction digits.
Used when rounding or formatting an amount for display. Actual storage precision can be greater.
getLocale
Gets the locale.
The currency name and symbol are locale specific.
Automatically generated on 2025-03-18