def human_readable(size):
    """Build a nice human readable string from a size given in
    bytes

    """
    if size < 1024 ** 2:
        hreadable = float(size) / 1024.0
        return '%.0fK' % hreadable
    elif size < 1024 ** 3:
        hreadable = float(size) / 1024 ** 2
        return '%.1fM' % round(hreadable, 1)
    else:
        hreadable = float(size) / 1024.0 ** 3
        return '%.2fG' % round(hreadable, 2)
