src/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php
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);
    }
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);
    }
Transforms a normalized format into a localized money string.

@param string|int|float|array $value

@throws TransformationFailedException If the given value is not numeric or
if the value can not be transformed

@return string Localized money string