Format.currency ViewHelper <f:format.currency> 

ViewHelper which formats a given float to a currency representation.

Go to the source code of this ViewHelper: Format\CurrencyViewHelper.php (GitHub).

Examples 

Defaults 

packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html
<f:format.currency>123.456</f:format.currency>
Copied!
Output
123,46
Copied!

All parameters 

packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html
<f:format.currency decimalSeparator="." thousandsSeparator="," decimals="2"
  currencySign="$" prependCurrency="true" separateCurrency="false"
>
  54321
</f:format.currency>
Copied!
Output
$54,321.00
Copied!

Inline notation 

packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html
{someNumber -> f:format.currency(thousandsSeparator: ',', currencySign: 'EUR')}
Copied!
Output
54,321,00 EUR
Copied!

Depending on the value of {someNumber}.

Use dash for decimals without value 

packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html
<f:format.currency useDash="true">123.00</f:format.currency>
Copied!
Output
123,-
Copied!

Arguments of the <f:format.currency> ViewHelper 

currencySign

currencySign
Type
string
Default
''
The currency sign, eg $ or €.

decimalSeparator

decimalSeparator
Type
string
Default
','
The separator for the decimal point.

decimals

decimals
Type
int
Default
2
Set decimals places.

prependCurrency

prependCurrency
Type
bool
Default
false
Select if the currency sign should be prepended

separateCurrency

separateCurrency
Type
bool
Default
true
Separate the currency sign from the number by a single space, defaults to true due to backwards compatibility

thousandsSeparator

thousandsSeparator
Type
string
Default
'.'
The thousands separator.

useDash

useDash
Type
bool
Default
false
Use the dash instead of decimal 00