You can create a CultureInfo and specify that decimal separator will be ,:
var info = CultureInfo.InvariantCulture.Clone() as CultureInfo;
info.NumberFormat.NumberDecimalSeparator = ",";
double n = 123.456;
Console.WriteLine(n.ToString(info));
Output:
"123,456"
2
votes
It depends on you culture. If you specify the culture that uses comma all decimals wil be displayed with ",". If you need dot, choose the culture that uses "."
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more