def get_nice_size(size, base=1000.0):
    """
    Convert number of bytes to string with KB, MB, GB, TB suffixes
    """
    if size < base:
        return '%sB' % (size)

    if size < base**2:
        return '%.2fKB' % (size / base)

    if size < base**3:
        return '%.2fMB' % (size / base**2)

    if size < base**4:
        return '%.2fGB' % (size / base**3)

    return '%.2fTB' % (size / base**4)