def formatted_float(f, precision=2):
    """
    Returns formatted float value to given precision (or less).

    :param float f: Float value.
    :return: Formatted float value.
    :rtype: str
    """
    return '{:.{precision}f}'.format(f, precision=precision).rstrip('0'
        ).rstrip('.')
