8
Answers

Converting a string into double

Ask a question
Sven Nijs

Sven Nijs

14y
9.1k
1
I'm trying to convert a string into a doble in this way:

string latitude = reader.GetAttribute("lat");
string longitude = reader.GetAttribute("lon");
double lat = Convert.ToDouble(latitude);
double lon = Convert.ToDouble(longitude);

When latitude has a value of: 51.66777, lat has a value of 51667777... The same problem for longitude. When I convert the string, the point disappear. Can someone help me?

Thanks!

Answers (8)