class CurrencyFormatter

Class CurrencyFormatter

Properties

protected $decimals

Methods

__construct(int $decimals = 2)

No description

string
formatMoney(mixed $money, string $decPoint = ',', string $thousandsSep = ' ')

Formats the given Money object INCLUDING the currency symbol

string
formatAmount(Money $money, string $decPoint = ',', string $thousandsSep = ' ')

Formats the amount part of the given Money object WITHOUT INCLUDING the currency symbol

float
asFloat(Money $money)

Returns the amount for the given Money object as simple float

string
formatCurrency(Money $money)

Formats only the currency part of the given Money object

string
formatCurrencyAsSymbol(Currency $currency)

Returns the symbol corresponding to the given currency

Details

at line 27
__construct(int $decimals = 2)

Parameters

int $decimals

at line 41
string formatMoney(mixed $money, string $decPoint = ',', string $thousandsSep = ' ')

Formats the given Money object INCLUDING the currency symbol

Parameters

mixed $money
string $decPoint
string $thousandsSep

Return Value

string

at line 64
string formatAmount(Money $money, string $decPoint = ',', string $thousandsSep = ' ')

Formats the amount part of the given Money object WITHOUT INCLUDING the currency symbol

Parameters

Money $money
string $decPoint
string $thousandsSep

Return Value

string

at line 78
float asFloat(Money $money)

Returns the amount for the given Money object as simple float

Parameters

Money $money

Return Value

float

at line 92
string formatCurrency(Money $money)

Formats only the currency part of the given Money object

Parameters

Money $money

Return Value

string

at line 103
string formatCurrencyAsSymbol(Currency $currency)

Returns the symbol corresponding to the given currency

Parameters

Currency $currency

Return Value

string