‪TYPO3CMS  10.4
TYPO3\CMS\Fluid\ViewHelpers\Format\NumberViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Format\NumberViewHelper:

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 number with custom precision, decimal point and grouped thousands. See https://www.php.net/manual/function.number-format.php.

Examples

Defaults

::

<f:format.number>423423.234</f:format.number>

423,423.20

With all parameters

::

<f:format.number decimals="1" decimalSeparator="," thousandsSeparator="."> 423423.234 </f:format.number>

423.423,2

Definition at line 49 of file NumberViewHelper.php.

Member Function Documentation

◆ initializeArguments()

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

Initialize arguments.

Exceptions

Definition at line 63 of file NumberViewHelper.php.

◆ renderStatic()

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

Format the numeric value as a number with grouped thousands, decimal point and precision.

Parameters
array$arguments
\Closure$renderChildrenClosure
RenderingContextInterface$renderingContext
Returns
‪string The formatted number

Definition at line 80 of file NumberViewHelper.php.

Member Data Documentation

◆ $escapeChildren

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

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

Definition at line 56 of file NumberViewHelper.php.