In my app i use the following
newTotal.ToString("c", (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone())
to convert a inputted number to the number format of the phone. But is there a easy way to convert it back to a simple number again?
In my app i use the following
newTotal.ToString("c", (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone())
to convert a inputted number to the number format of the phone. But is there a easy way to convert it back to a simple number again?
Just use double.parse, like this:
var text = (1234,567).ToString("c");
var number = double.Parse(text, System.Globalization.NumberStyles.Currency, cultureInfo);