I have issue over using the CultureInfo call for getting the current culture from my machine. I have to use the number seperator as comma(,) instead of dot(.)
I went to regional settings->Additional Settings->Decimal symbol is set to comma(,).
I have my code as shown below
double number = 123.456;
string convertToString = Convert.ToString(number, CultureInfo.CurrentCulture);
I am getting my output same as 123.456, but my expected output is 123,456 (since i have set the decimal symbol as comma)
I tried explictly setting the number format as shown below
CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
culture.NumberFormat.NumberDecimalSeparator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
I tried this in sample console application and i am getting the desired output(123,456), but if i try in WPF application, its not working.
Can I know where exactly i am doing wrong!