

def format_and_scale_fraction(numerator, denominator, unit):
    '\n    Picks a good scale for representing a fraction, and formats it.\n    '
    if (denominator < 1000):
        return ('%d / %d %s' % (numerator, denominator, unit))
    (scale, suffix) = _pick_scale_and_suffix(denominator)
    scaled_denominator = (denominator / scale)
    if (scaled_denominator < 10.0):
        fmt = '%1.2f / %1.2f %s%s'
    elif (scaled_denominator < 100.0):
        fmt = '%1.1f / %1.1f %s%s'
    else:
        fmt = '%1.0f / %1.0f %s%s'
    scaled_numerator = (numerator / scale)
    return (fmt % (scaled_numerator, scaled_denominator, suffix, unit))

dataset/ETHPy150Open Backblaze/B2_Command_Line_Tool/b2/utils.py format_and_scale_fraction/original