The twig documentation describes how to set the default parameters for the number_format
extension. How can I set this in Symfony 2?
Symfony2 does not give access to core extension of twig. You can create a kernel.request
event listener, inject twig
service and in onKernelRequest
method of the listener you have to add
$this->twig->getExtension('core')->setNumberFormat(3, ',', '.');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With