formatter = $formatter; } public function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefault('precision', 2); $resolver->setDefault('unit', ''); } public function normalize($value) { //Ignore null values if ($value === null) { return ''; } return $this->formatter->format((float) $value, $this->options['unit'], $this->options['precision']); } }