def _number(string):
    """
        Extracts an int from a string.
        Returns a 0 if None or an empty string was passed.
    """
    if not string:
        return 0
    elif string == '':
        return 0
    else:
        try:
            return int(string)
        except ValueError:
            return float(string)
