Class waCurrency
Methods summary
public static
array
|
#
getInfo( string $currency )
Returns information about a currency by its ISO3 code, which is retrieved
from its config file located in
wa-system/currency/data/.
Returns information about a currency by its ISO3 code, which is retrieved
from its config file located in wa-system/currency/data/.
Parameters
- $currency
string $currency Currency's ISO3 code
Returns
array
|
public static
|
|
public static
string
|
#
format( string $format, float $n, string $currency, string $locale = null )
Returns formatted amount value with currency.
Returns formatted amount value with currency.
Parameters
- $format
string $format Amount format. The format string must begin with % character and may
contain the following optional parts in the specified order: - Precision (number
of digits after decimal separator) expressed as an arbitrary integer value. If
not specified, then 2 decinal digits are displayed by default. - Display type
(as a number; e.g., "123456", or in words; e.g., 'one hundred and twenty-three
thousand four hundred and fifty-six"). To use the numerical format, specify i;
for verbal format, use w. The verbal expression of a number contains its integer
part only, the decimal part is ignored. If the display type is not specified,
then the numerical format is used by default. - Currency sign or name. To add it
to the formatted amount value, specify one of the following identifiers in curly
brackets: {n}: full cyrrency name; e.g., "dollar" {s}: brief currency name or
sign; e.g., "$" {f}: name of the fractional currency unit; e.g., "cent/cents"
{c}: currency code; e.g., "USD".
- $n
float $n Original number to be formatted
- $currency
string $currency Currency's ISO3 code
- $locale
string $locale Locale id
Returns
string E.g., 'en_US'
See
|
private static
|
|
protected static
|
|
public static
|
#
getAll( string|boolean $type = 'title' )
Returns the list of all available currencies.
Returns the list of all available currencies.
Parameters
- $type
string|boolean $type Currency data item id specified in currency cofiguration file in
wa-system/currency/data/: - 'all': this value (or true), returns all currency
data items - 'code': currency ISO3 code - 'sign': currency symbol - 'title':
currency name
|
Properties summary
protected static
mixed
|
$data
|
|
|
protected static
array
|
$format_data
|
array() |
|