I have changed Global Application Culture thread for currency number format in (fr-CA) as shown below.
Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencyPositivePattern = 1;
Thread.CurrentThread.CurrentUICulture.NumberFormat.CurrencyNegativePattern = 5;
CultureInfo CADCultureref = new CultureInfo("fr-CA");
CADCultureref = Thread.CurrentThread.CurrentCulture;
NumberFormatInfo CADNumFormatref = new NumberFormatInfo();
CADNumFormatref = Thread.CurrentThread.CurrentCulture.NumberFormat;
CADNumFormatref.CurrencyGroupSeparator = ".";
CADNumFormatref.CurrencyDecimalSeparator = ",";
CADCultureref.NumberFormat = CADNumFormatref;
Thread.CurrentThread.CurrentCulture = CADCultureref;
Thread.CurrentThread.CurrentUICulture = CADCultureref;
Then I try to parsing value from currency as shown below:
Decimal digit = 1000000;
String currency = digit.ToString("C"); // 1.000.000,00$ (fr-CAD)
decimal parseValue = decimal.Parse(currency , System.Globalization.NumberStyles.Currency | System.Globalization.NumberStyles.Number);
I am getting exception "{Input String is not in correct format}" during parsing value.
Unable to parse due to changing in group seperator and decimal seperator in Numberformatinfo of CurrentThread.
I need to show "," in place of "." and "." in place of ",".