def digits(num):
    """Get number of digits after decimal point.

    Parameters
    ----------
    num : str
        string that represents a number

    Returns
    -------
    int
        number of digits after decimal point
    """
    if not num.replace('.', '').isdigit() or num.count('.') != 1:
        raise ValueError('Not a valid float number: %s' % num)
    return len(num.split('.')[1])