String representation of a decimal value is culture specific.
Convert.ToString(decimal)
method uses current culture thread.
Here how it's implemented;
public static string ToString(decimal value)
{
return value.ToString(CultureInfo.CurrentCulture);
}
Probably one of your OS uses a culture that have .
as NumberDecimalSeparator
and the other one uses a culture that have ,
as a NumberDecimalSeparator
.
How can I stop this ? is .NET can handle this internally ?
.NET can't handle this. It uses whatever it founds as a current culture.
But you can.
Using the same culture thread in your both OS can solve this issue or you can use CultureInfo.Clone
method to clone your current culture and set your NumberDecimalSeparator
property what ever string you want.