Hi Brigitte,
you can use the Format component (but you can also use the Format()
method in the expressions if you want.
I don’t think you understand how formatting works based on your solution. What you do is provide a formatting pattern, which contains one or more indices in curly braces. These indices are then replaced by the actual values you have. So if you have three numbers called x
, y
, and z
(with values 1.2, 2.5 and 4.87 for arguments sake) you can format them using the following expression:
Format("{0}, {1}, {2}", x, y, z)
which should yield (1.2, 2.5, 4.87)
.
You can also plug the x, y and z values into the Format component inputs, in which case you only have to supply the pattern text, which is "({0}, {1}, {2})"
.
Alternatively you could create the text just by concatenating the values. In an expression this would look like:
"(" & x & ", " & y & ", " & z & ")"
I find such a notation always very difficult to read.
Another benefit with the formatting approach is that you can specify formatting hints. For example if you want all the coordinate numbers to have exactly 3 decimal places, you can use the pattern "({0:0.000}, {1:0.000}, {2:0.000})"
, which would yield "(1.200, 2.500, 4.870)"
.
One final thing, if you want to have curly braces in your result, you’ll need to use double-curly-braces in the pattern. So "{{{0}, {1}, {2}}}"
yields "{1.2, 2.5, 4.87}"