public function transform($value)
    {
        if (null === $value) {
            return '';
        }

        if (!is_numeric($value)) {
            throw new UnexpectedTypeException($value, 'numeric');
        }

        $formatter = $this->getNumberFormatter(\NumberFormatter::CURRENCY);
        $value /= $this->divisor;

        if (null !== $this->currency) {
            $value = $formatter->formatCurrency($value, $this->currency);
        } else {
            $value = $formatter->format($value);
        }

        if (0 !== $formatter->getErrorCode()) {
            throw new TransformationFailedException($formatter->getErrorMessage());
        }

        return $value;
    }