# File lib/linguistics/en.rb, line 1242
    def numwords( number, hashargs={} )
        num = number.to_s
        config = NumwordDefaults.merge( hashargs )
        raise "Bad chunking option: #{config[:group]}" unless
            config[:group].between?( 0, 3 )

        # Array of number parts: first is everything to the left of the first
        # decimal, followed by any groups of decimal-delimted numbers after that
        parts = []

        # Wordify any sign prefix
        sign = (/\A\s*\+/ =~ num) ? 'plus' : (/\A\s*\-/ =~ num) ? 'minus' : ''

        # Strip any ordinal suffixes
        ord = true if num.sub!( /(st|nd|rd|th)\Z/, '' )

        # Split the number into chunks delimited by '.'
        chunks = if !config[:decimal].empty? then
                     if config[:group].nonzero?
                         num.split(/\./)
                     else
                         num.split(/\./, 2)
                     end
                 else
                     [ num ]
                 end

        # Wordify each chunk, pushing arrays into the parts array
        chunks.each_with_index {|chunk,section|
            chunk.gsub!( /\D+/, '' )

            # If there's nothing in this chunk of the number, set it to zero
            # unless it's the whole-number part, in which case just push an
            # empty array.
            if chunk.empty?
                if section.zero?
                    parts.push []
                    next 
                end
            end

            # Split the number section into wordified parts unless this is the
            # second or succeeding part of a non-group number
            unless config[:group].zero? && section.nonzero?
                parts.push number_to_words( chunk, config )
            else
                parts.push number_to_words( chunk, config.merge(:group => 1) )
            end                  
        }

        debug_msg "Parts => #{parts.inspect}"

        # Turn the last word of the whole-number part back into an ordinal if
        # the original number came in that way.
        if ord && !parts[0].empty?
            parts[0][-1] = ordinal( parts[0].last )
        end

        # If the caller's expecting an Array return, just flatten and return the
        # parts array.
        if config[:asArray]
            unless sign.empty?
                parts[0].unshift( sign )
            end
            return parts.flatten
        end

        # Catenate each sub-parts array into a whole number part and one or more
        # post-decimal parts. If grouping is turned on, all sub-parts get joined
        # with commas, otherwise just the whole-number part is.
        if config[:group].zero?
            if parts[0].length > 1

                # Join all but the last part together with commas
                wholenum = parts[0][0...-1].join( config[:comma] )

                # If the last part is just a single word, append it to the
                # wholenum part with an 'and'. This is to get things like 'three
                # thousand and three' instead of 'three thousand, three'.
                if /^\s*(\S+)\s*$/ =~ parts[0].last
                    wholenum += config[:and] + parts[0].last
                else
                    wholenum += config[:comma] + parts[0].last
                end
            else
                wholenum = parts[0][0]
            end
            decimals = parts[1..-1].collect {|part| part.join(" ")}

            debug_msg "Wholenum: #{wholenum.inspect}; decimals: #{decimals.inspect}"

            # Join with the configured decimal; if it's empty, just join with
            # spaces.
            unless config[:decimal].empty?
                return sign + ([ wholenum ] + decimals).
                    join( " #{config[:decimal]} " ).strip
            else
                return sign + ([ wholenum ] + decimals).
                    join( " " ).strip
            end
        else
            return parts.compact.
                separate( config[:decimal] ).
                delete_if {|el| el.empty?}.
                join( config[:comma] ).
                strip
        end
    end