def size(n, abbriv = 'B', si = False):
    """Convert number to human readable form"""
    base = 1000.0 if si else 1024.0
    if n < base:
        return '%d%s' % (n, abbriv)

    for suffix in ['K', 'M', 'G', 'T']:
        n /= base
        if n <= base:
            num = '%.02f' % n
            # while num[-1] == '0':
            #     num = num[:-1]
            # if num[-1] == '.':
            #     num = num[:-1]
            return '%s%s%s' % (num, suffix, abbriv)

    return '%.02fP%s' % (n, abbriv)