im using visual studio 2008. my desktop application works in different regional settings.
in my code, I have decimal numbers in string variables in English format, I want to convert them to decimal variables, using Convert.ToDecimal()regional settings like "Spanish (Ecuador).
when i do the following:
string myNum = "0.04";
decimal myDec = Convert.ToDecimal(myNum);
when i used
Convert.ToDecimal(myNum, new CultureInfo("en-US"));
I can’t add a new one CultureInfo("en-Us")for each operator, because I have used conversion operations more than 100 times.
how can i achieve this. please, help?
source
share