def array_to_string(array, delimiter=" ", format="{}", precision=None):
    """
    Converts a numeric array into the string format in mujoco.

    Examples:
        [0, 1, 2] => "0 1 2"
    """
    if precision is not None and format == "{}":
        return delimiter.join([format.format(round(x, precision)) for x in array])
    else:
        return delimiter.join([format.format(x, precision) for x in array])