def get_string_names(elems, names, label):
    """
    Transform the list of values into a string to write

    elems is a dictionary with the values
    names is the selected keys we want for the output
    label is the model label
    """

    # Start to write the output string
    ss = ""
    for name in names:

        # Get back the value
        val = elems[name]

        # Be careful with undefined values
        if val == "-":
            ss += " -"
        else:
            # Add to the string
            ss += f" {val:6.3f}"

    # Add newline
    ss += " " + label + "\n"

    return ss