‪TYPO3CMS  11.5
TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper:

Public Member Functions

 initializeArguments ()
 

Static Public Member Functions

static string renderStatic (array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 

Protected Attributes

bool $escapeChildren = false
 

Detailed Description

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,-

Definition at line 78 of file CurrencyViewHelper.php.

Member Function Documentation

◆ initializeArguments()

TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::initializeArguments ( )

Initialize arguments.

Exceptions

Definition at line 92 of file CurrencyViewHelper.php.

◆ renderStatic()

static string TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::renderStatic ( array  $arguments,
\Closure  $renderChildrenClosure,
RenderingContextInterface  $renderingContext 
)
static

Formats a float to currency formatting

Parameters
array$arguments
\Closure$renderChildrenClosure
RenderingContextInterface$renderingContext
Returns
‪string the formatted amount

Definition at line 112 of file CurrencyViewHelper.php.

References $output.

Member Data Documentation

◆ $escapeChildren

bool TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::$escapeChildren = false
protected

Output is escaped already. We must not escape children, to avoid double encoding.

Definition at line 85 of file CurrencyViewHelper.php.