I'm seeing an issue in a production ASP.NET application that involves the following code, which is used to render the geocoordinates of a particular object:
private double _longitude;
private double _latitude;
public string ToCsvString()
{
return _latitude + "," + _longitude;
}
Thread.CurrentThread.CurrentCulture will be set to different values based on the incoming request. The behavior I'm seeing is that the result of this function will vary independent of the threadlocal culture. At times the decimal points and commas are incorrect for the current culture. More strangely, it seems that once set wrong, the wrong value persists.
Does ToString on double cache values?