TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper:
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper Tx_Fluid_ViewHelpers_Format_CurrencyViewHelper

Public Member Functions

 render ($currencySign='', $decimalSeparator=',', $thousandsSeparator='.', $prependCurrency=FALSE, $separateCurrency=TRUE, $decimals=2)
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 isEscapingInterceptorEnabled ()
 
 setViewHelperNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
 
 setRenderChildrenClosure (\Closure $renderChildrenClosure)
 
 initializeArgumentsAndRender ()
 
 initialize ()
 
 renderChildren ()
 
 prepareArguments ()
 
 validateArguments ()
 
 initializeArguments ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 resetState ()
 

Additional Inherited Members

- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Protected Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 registerArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 overrideArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 callRenderMethod ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 
- Protected Attributes inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = NULL
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = TRUE
 

Detailed Description

Formats a given float to a currency representation.

= Examples =

<f:format.currency>123.456</f:format.currency> <output> 123,46 </output>

<f:format.currency currencySign="$" decimalSeparator="." thousandsSeparator="," prependCurrency="TRUE" separateCurrency="FALSE" decimals="2">54321</f:format.currency> <output> $54,321.00 </output>

{someNumber -> f:format.currency(thousandsSeparator: ',', currencySign: '€')} <output> 54,321,00 € (depending on the value of {someNumber}) </output>

Definition at line 42 of file CurrencyViewHelper.php.

Member Function Documentation

◆ render()

TYPO3\CMS\Fluid\ViewHelpers\Format\CurrencyViewHelper::render (   $currencySign = '',
  $decimalSeparator = ',',
  $thousandsSeparator = '.',
  $prependCurrency = FALSE,
  $separateCurrency = TRUE,
  $decimals = 2 
)
Parameters
string$currencySign(optional) The currency sign, eg $ or €.
string$decimalSeparator(optional) The separator for the decimal point.
string$thousandsSeparator(optional) The thousands separator.
boolean$prependCurrency(optional) Select if the curreny sign should be prepended
boolean$separateCurrency(optional) Separate the currency sign from the number by a single space, defaults to true due to backwards compatibility
integer$decimals(optional) Set decimals places.
Returns
string the formatted amount.

Definition at line 54 of file CurrencyViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\renderChildren().