def percent(num, div, prec=2):
    """
    Returns the percentage of num/div as float

    Args:
        num (int): numerator
        div (int): divisor
        prec (None, int): rounding precision

    Returns:
        p (float)
            p = 100 * num/div
    """
    num = float(num)
    div = float(div)
    if div == 0:
        return 0.0             # no division by zero
    p = round(100 * num / div, prec)
    return p