

def _pick_scale_and_suffix(x):
    suffixes = ' kMGTP'
    ref_digits = str(int(x))
    index = ((len(ref_digits) - 1) // 3)
    suffix = suffixes[index]
    if (suffix == ' '):
        suffix = ''
    scale = (1000 ** index)
    return (scale, suffix)

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