Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
Format.number ViewHelper <f:format.number>
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
Source code
Go to the source code of this ViewHelper: NumberViewHelper.php (GitHub).
Arguments
The following arguments are available for <f:
:
decimals
-
- Type
- mixed
- Default
'2'
The number of digits after the decimal point
decimalSeparator
-
- Type
- string
- Default
'.'
The decimal point character
thousandsSeparator
-
- Type
- string
- Default
','
The character for grouping the thousand digits