System.FormatException : Input string was not in a correct format ,on converting string to decimal.

后端 未结 4 1394
旧巷少年郎
旧巷少年郎 2021-01-05 11:51

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

4条回答
  •  梦毁少年i
    2021-01-05 12:08

    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);
    

提交回复
热议问题