I need to format a number with a specific format. I don’t want to decide on the format with the regional settings of the computer so I’m trying:
string s = "219171"
string result = Convert.ToDouble(s).ToString("0,0.0") //219,171.0
string result = Convert.ToDouble(s).ToString("0.0,0") //219171.00
I want to display it as
219.171,00
Thank you
Create a custom NumberFormatInfo instance and pass that in when calling ToString().
NumberFormatInfobelongs toSystem.Globalization