def bytesize(size):
    """
    Returns a formatted version of a ``size`` given in bytes.
    """
    if size > 1073741824:
        return str(0.1 * int(10 * (float(size) / 1073741824))) + ' GB'
    elif size > 1048576:
        return str(0.1 * int(10 * (float(size) / 1048576))) + ' MB'
    elif size > 1024:
        return str(0.1 * int(10 * (float(size) / 1024))) + ' KB'
    else:
        return str(size) + 'B'
