After a double has been formatted to currency, is there no way to convert the currency string back to a double for calculations?
I though specifying the CultureInfo may help in the conversion but it doesn't.
What's the simplest way to do this?Code:CultureInfo ci = Thread.CurrentThread.CurrentCulture; double d = -56254.3856; string strInput = String.Format(ci, "{0:c}", d); Console.WriteLine(strInput); // ($56,254.39) d = Convert.ToDouble(strInput, ci); // fails Console.WriteLine(d);




Reply With Quote