def convert_size(number):
    """
    Convert and integer to a human-readable B/KB/MB/GB/TB string.

    :param number:
        integer to be converted to readable string
    :type number: ``int``

    :returns: `str`
    """
    for x in ['B', 'KB', 'MB', 'GB']:
        if number < 1024.0:
            string = "%3.1d%s" % (number, x)
            return string.strip()
        number /= 1024.0
    string = "%3.1f%s" % (number, 'TB')
    return string.strip()