src/i18n/Formatter.php
public function asSpellout($value)
    {
        if ($value === null) {
            return $this->getNullDisplay();
        }
        $value = $this->normalizeNumericValue($value);
        if ($this->_intlLoaded) {
            $f = $this->createNumberFormatter(NumberFormatter::SPELLOUT);
            if (($result = $f->format($value)) === false) {
                throw new InvalidArgumentException('Formatting number as spellout failed: ' . $f->getErrorCode() . ' ' . $f->getErrorMessage());
            }

            return $result;
        }

        throw new InvalidConfigException('Format as Spellout is only supported when PHP intl extension is installed.');
    }
public function asSpellout($value)
    {
        if ($value === null) {
            return $this->getNullDisplay();
        }
        $value = $this->normalizeNumericValue($value);
        if ($this->_intlLoaded) {
            $f = $this->createNumberFormatter(NumberFormatter::SPELLOUT);
            if (($result = $f->format($value)) === false) {
                throw new InvalidArgumentException('Formatting number as spellout failed: ' . $f->getErrorCode() . ' ' . $f->getErrorMessage());
            }

            return $result;
        }

        throw new InvalidConfigException('Format as Spellout is only supported when PHP intl extension is installed.');
    }
public function asSpellout ( $ value ) { if ( $ value === null ) { return $ this -> getNullDisplay ( ) ; } $ value = $ this -> normalizeNumericValue ( $ value ) ; if ( $ this -> _intlLoaded ) { $ f = $ this -> createNumberFormatter ( NumberFormatter :: SPELLOUT ) ; if ( ( $ result = $ f -> format ( $ value ) ) === false ) { throw new InvalidArgumentException ( 'Formatting number as spellout failed: ' . $ f -> getErrorCode ( ) . ' ' . $ f -> getErrorMessage ( ) ) ; } return $ result ; } throw new InvalidConfigException ( 'Format as Spellout is only supported when PHP intl extension is installed.' ) ; }
Formats the value as a number spellout.

This function requires the [PHP intl extension](http://php.net/manual/en/book.intl.php) to be installed.
This formatter does not work well with very big numbers.

@param mixed $value the value to be formatted
@return string the formatted result.
@throws InvalidArgumentException if the input value is not numeric or the formatting failed.
@throws InvalidConfigException when the [PHP intl extension](http://php.net/manual/en/book.intl.php) is not available.
Formats the value as a number spellout .