src/View/Helper/NumbersToWordsHelper.php
public function spell($item)
    {
        $formatter = new NumberFormatter($this->config['locale'], NumberFormatter::SPELLOUT);

        if (is_int($item)) {
            return $formatter->format($item);
        }

        return preg_replace_callback('/([0-9]+)/', function ($matches) use ($formatter) {
            return $formatter->format($matches[0]);
        }, $item);
    }
public function spell($item)
    {
        $formatter = new NumberFormatter($this->config['locale'], NumberFormatter::SPELLOUT);

        if (is_int($item)) {
            return $formatter->format($item);
        }

        return preg_replace_callback('/([0-9]+)/', function ($matches) use ($formatter) {
            return $formatter->format($matches[0]);
        }, $item);
    }
public function spell ( $ item ) { $ formatter = new NumberFormatter ( $ this -> config [ 'locale' ] , NumberFormatter :: SPELLOUT ) ; if ( is_int ( $ item ) ) { return $ formatter -> format ( $ item ) ; } return preg_replace_callback ( '/([0-9]+)/' , function ( $ matches ) use ( $ formatter ) { return $ formatter -> format ( $ matches [ 0 ] ) ; } , $ item ) ; }
Convert a number into a word

@param int|string $item An integer number to convert or a string containing an integer
@return string
Convert a number into a word