def format_usage(usage, rate):
    """format the resource usage to show integer if greater than the rate, otherwise
    show one decimal place."""
    usage = float(usage) / rate

    if usage < 1:
        usage = round(usage, 1)
    else:
        usage = int(round(usage, 0))
    return usage