CurrencyViewHelper extends AbstractViewHelper uses CompileWithRenderStatic
This class is the implementation of a Fluid ViewHelper.
View this class in the TYPO3 ViewHelper reference: <f:format.currency>
Formats a given float to a currency representation.
Examples
Defaults
::
<f:format.currency>123.456</f:format.currency>
Output::
123,46
All parameters
::
<f:format.currency decimalSeparator="." thousandsSeparator="," decimals="2" currencySign="$" prependCurrency="true" separateCurrency="false"
54321
</f:format.currency>
Output::
$54,321.00
Inline notation
::
{someNumber -> f:format.currency(thousandsSeparator: ',', currencySign: 'EUR')}
Output::
54,321,00 EUR
Depending on the value of {someNumber}
.
Use dash for decimals without value
::
<f:format.currency useDash="true">123.00</f:format.currency>
Output::
123,-
Table of Contents
Properties
- $escapeChildren : bool
- Output is escaped already. We must not escape children, to avoid double encoding.
Methods
- initializeArguments() : mixed
- Initialize arguments.
- renderStatic() : string
- Formats a float to currency formatting
Properties
$escapeChildren
Output is escaped already. We must not escape children, to avoid double encoding.
protected
bool
$escapeChildren
= false
Methods
initializeArguments()
Initialize arguments.
public
initializeArguments() : mixed
Tags
renderStatic()
Formats a float to currency formatting
public
static renderStatic(array<string|int, mixed> $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) : string
Parameters
- $arguments : array<string|int, mixed>
- $renderChildrenClosure : Closure
- $renderingContext : RenderingContextInterface
Return values
string —the formatted amount