D
D
DmitryLife2019-06-15 15:35:38
C++ / C#
DmitryLife, 2019-06-15 15:35:38

Why is the dot replaced with a comma?

I declare a variable

public Vector2 PlayerPosition = new Vector2(42.3627f, -71.05686f);

Paste in URL
Url = "http://open.mapquestapi.com/staticmap/v4/getmap?key=" + Key + "&size=1280,1280&zoom=" + _zoom + "&type=" + _maptype + "&center=" + PlayerPosition.x + "," + PlayerPosition.y;

And the values ​​"42.3627, -71.05686" get into the center parameter, instead of "42.3627, -71.05686"
What could be the reason for this and how can it be changed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Yudakov, 2019-06-15
@DmitryLife

Because in Russian the decimal separator is a comma.
And if it is necessary in a programmer's format - with a dot, then we use:
int.ToString(CultureInfo.InvariantCulture)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question