Handles the string containing numeric case of cell and attempts
    auto-conversion for auto_convert_cell.

def auto_convert_numeric_string_cell(flagable, cell_str, position, worksheet, flags, units):
    '''
    Handles the string containing numeric case of cell and attempts
    auto-conversion for auto_convert_cell.
    '''
    def numerify_str(cell_str, flag_level='minor', flag_text=""):
        '''
        Differentiates between int and float strings. Expects a numeric string.
        '''
        if re.search(allregex.integer_regex, cell_str):
            flagable.flag_change(flags, flag_level, position, worksheet)
            return int(cell_str)
        else:
            flagable.flag_change(flags, flag_level, worksheet, position)
            return float(cell_str)
    def numerify_percentage_str(cell_str, flag_level='minor', flag_text=""):
        flagable.flag_change(flags, flag_level, position, worksheet)
        return float(cell_str) / 100

    def convert_to_int_or_float(cell_str, flag_level='minor', flag_text=""):
        if not cell_str:
            conversion = 0
            flagable.flag_change(flags, 'warning', position, worksheet,
                                 flagable.FLAGS['empty-to-zero-string'])
        if re.search(allregex.numerical_regex, cell_str):
            conversion = numerify_str(cell_str, flag_level, flag_text)
        # Comma separated?
        elif re.search(allregex.comma_sep_numerical_regex, cell_str):
            smashed_cell = ''.join(cell_str.split(','))
            conversion = numerify_str(smashed_cell, flag_level, flag_text)
        # Ends in percentage sign
        elif re.search(allregex.percent_numerical_regex, cell_str):
            cell_str = allregex.percent_numerical_regex.search(cell_str).group(1)
            conversion = numerify_percentage_str(cell_str, flag_level, flag_text)
        # Ends in + or - sign (estimate)?
        elif re.search(allregex.estimate_numerical_regex, cell_str):

            cell_str = cell_str[:-1].replace(",","")
            conversion = numerify_str(cell_str, flag_level, flag_text)
        # Begins with money symbol?
        elif re.search(allregex.begins_with_monetary_symbol_regex, cell_str):
            symbol = cell_str[0]
            cell_str = cell_str[1:]
            try:
                conversion = convert_to_int_or_float(cell_str, 'interpreted',
                        flagable.FLAGS['monetary-removal'])
                if re.search(allregex.contains_dollar_symbol_regex, symbol):
                    units[position] = UNITS_DOLLAR
                elif re.search(allregex.contains_pound_symbol_regex, symbol):
                    units[position] = UNITS_POUND
                elif re.search(allregex.contains_euro_symbol_regex, symbol):
                    units[position] = UNITS_EURO
            except ValueError:
                conversion = cell_str
                flagable.flag_change(flags, 'warning', position, worksheet,
                                    flagable.FLAGS['failed-monetary-convert'])
        # Number ending in 'k'?
        elif re.search(allregex.ends_with_thousands_scaling_regex, cell_str):
            cell_str = cell_str.rstrip()[:-1]
            try:
                conversion = 1000*convert_to_int_or_float(cell_str, 'interpreted',
                                  flagable.FLAGS['thousands-convert'])
            except ValueError:
                flagable.flag_change(flags, 'warning', position, worksheet,
                                    flagable.FLAGS['failed-thousands-convert'])
        # Number ending in 'M' or 'MM'?
        elif re.search(allregex.ends_with_millions_scaling_regex, cell_str):
            if cell_str[-2] == "M":
                cell_str = cell_str[:-2]
            else:
                cell_str = cell_str[:-1]
            try:
                conversion = 1000000*convert_to_int_or_float(cell_str, 'interpreted',
                        flagable.FLAGS['millions-convert'])
            except ValueError:
                flagable.flag_change(flags, 'warning', position, worksheet,
                                     flagable.FLAGS['failed-millions-convert'])
        else:
            raise ValueError("Cannot convert cell")
        return conversion


    # Try converting
    try:
        return convert_to_int_or_float(cell_str)
    # Couldn't convert?
    except ValueError:
        flagable.flag_change(flags, 'minor', position, worksheet,
                             flagable.FLAGS['failed-convert-numeric-string'])
        return cell_str