I have a little problem with ASP.NET and C#. This is my error code:
An exception of type \'System.FormatException\' occurred in mscorlib.dll but was not
Please try with the below code snippet.
CultureInfo info = CultureInfo.GetCultureInfo("es-ES");
string storedValue = "3,85";
decimal oldAmount;
bool succes = Decimal.TryParse(storedValue, NumberStyles.Any, info, out oldAmount);
Try using "0,85" instead of "0.85". I think you can use the dot decimal if you change culture. Here is some more information: How to change symbol for decimal point in double.ToString()?
Use TextBox.Text instead:
bool succes = Decimal.TryParse(TextBox.Text, out oldAmount);
TextBox.value is wrong. YourTextBox.Text is correct...!
bool success = Decimal.TryParse(TextBox.Text, out oldAmount);