def hfloat(f, p=5):
    """Convert float to value suitable for humans.

    Arguments:
        f (float): The floating point number.
        p (int): Floating point precision (default is 5).

    Copied from celery
    """
    i = int(f)
    return i if i == f else '{0:.{p}}'.format(f, p=p)
