Here is the output of displaying some tuples and arrays as strings in the German (de-DE) culture, which uses a comma as the decimal point:
let x = (1.1, 1, 1);
let y = [1.1, 1.0, 1.0];
Message($"{x}");
Message($"{y}");
(1,1, 1, 1)
[1,1,1,1]
It is difficult to tell what the real value of the tuple is, and is actually impossible to tell what the real value of the array is (it's not an array of 4 ints). Intuitively we expect the string output of Q# tuples and arrays to follow Q# syntax, which is why I think using the invariant culture here probably makes sense.
As a note, C# has the same problem with tuples (Q# tuples end up calling C#'s ValueTuple.ToString in the end):
> var x = (1.1, 1.0, 1.0);;
> System.Console.WriteLine(x);;
(1,1, 1, 1)
This is related to #160, but that is probably more easily fixed by setting the current culture to the invariant culture for the duration of the test.
Here is the output of displaying some tuples and arrays as strings in the German (de-DE) culture, which uses a comma as the decimal point:
It is difficult to tell what the real value of the tuple is, and is actually impossible to tell what the real value of the array is (it's not an array of 4 ints). Intuitively we expect the string output of Q# tuples and arrays to follow Q# syntax, which is why I think using the invariant culture here probably makes sense.
As a note, C# has the same problem with tuples (Q# tuples end up calling C#'s
ValueTuple.ToStringin the end):This is related to #160, but that is probably more easily fixed by setting the current culture to the invariant culture for the duration of the test.