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

        if (is_array($value)) {
            return $this->doTransformation($value['currency'] ?: $this->defaultCurrency, (string) $value['amount']);
        }

        // Convert fixed spaces to normal ones.
        $value = str_replace("\xc2\xa0", ' ', (string) $value);

        if (false !== strpos($value, ' ')) {
            return $this->transformStringWithCurrencyToLocalized($value);
        }

        return $this->doTransformation($this->defaultCurrency, $value);
    }