def format_size(size):
    """
    format size for display
    """
    KBSize = 1024
    MBSize = 1024 * 1024
    if size < KBSize:
        return '%d bytes' % size
    elif size < MBSize:
        return '%d kb' % (size / KBSize)
    else:
        return '%d mb' % (size / MBSize)
