Change Decimal Separator

Hello

I have a class that I use to format a double value and return it as a string. I have been having a problem with culture settings that use a comma (rather than period) as the decimal separator. I tried the following :

static

{

System.Globalization.CultureInfo.get_CurrentCulture().get_NumberFormat().set_NumberDecimalSeparator(".");

}

which causes an exception to be thrown:

System.InvalidOperationException: Instance is read-only

Is it possible to do Am I trying to take too much of a shorcut

My current workaround involves checking characters from right to left and replacing the first "." I find (numbers are converted to string with decimal first).

 Thanks

 



Answer this question

Change Decimal Separator