def format_slack_message(table_name, metric, avg_time, increase, stddev, stddev_old):
    """ Formats slack message using slack emojis.

    :param table_name: BigQuery table name that was analysed.
    :param metric: string with metric name.
    :param avg_time: calculated average time for recent data of given metric.
    :param increase: percentage increase.
    :param stddev: calculated standard deviation based on historical data.
    :param stddev_old: calculated standard deviation based on historical data.
    :return: formatted message.
    """
    table_name_formatted = '`{}`'.format(table_name)
    # Depending on change value bold or highlight and add emoji
    if increase is None:
        increase_formatted = "NA"
    elif increase >= 0:
        increase_formatted = '`{:+.3f}%` :-1:'.format(increase)
    else:
        increase_formatted = '*{:+.3f}%* :+1:'.format(increase)

    # Bold if value available
    stddev_formatted = '*{:.2f}*'.format(stddev)
    stddev_old_formatted = '*{:.2f}*'.format(stddev_old)

    return '{} - \"{}\", avg_time {:.2f}s, change {}, stddev {}, stddev_old {} \n'.format(
        table_name_formatted, metric, avg_time, increase_formatted, stddev_formatted, stddev_old_formatted)