ep:price()} € */ class PriceViewHelper extends AbstractViewHelper { use CompileWithContentArgumentAndRenderStatic; public function initializeArguments(): void { parent::initializeArguments(); $this->registerArgument('value', 'mixed', 'Amount in euros'); } public static function renderStatic( array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext ): string { $amount = round((float) $renderChildrenClosure(), 2); $decimals = floor($amount) === $amount ? 0 : 2; return number_format($amount, $decimals, ',', ''); } }