def prettyPercent(numerator, denominator, format="%5.2f", na="na"):
    """output a percent value or "na" if not defined"""
    try:
        x = format % (100.0 * numerator / denominator)
    except (__HOLE__, ZeroDivisionError):
        x = "na"
    return x
dataset/ETHPy150Open CGATOxford/cgat/CGAT/IOTools.py/prettyPercent