def get_stix_indicator_score(indicator, default_score):
    """Returns a digit representing the indicator score.

    Converts from "high", "medium", or "low" into a digit, if necessary.
    """
    if not indicator.confidence:
        return default_score
    confidence_val_str = str(indicator.confidence.value)
    if confidence_val_str.isdigit():
        score = int(indicator.confidence.to_dict().get('value', default_score))
        return score
    elif confidence_val_str.lower() == 'high':
        return 7
    elif confidence_val_str.lower() == 'medium':
        return 5
    elif confidence_val_str.lower() == 'low':
        return 2
    else:
        return default_score
