Home > Net >  System. FormatException: "the format of the input string is not correct." how to deal with
System. FormatException: "the format of the input string is not correct." how to deal with

Time:10-06


System. FormatException: "input string format is not correct,"
How to deal with, small white for advice

CodePudding user response:

The current code verifies the validity of text box input, suggest to switch to float. TryParse

CodePudding user response:

Abc123.5 float. Parse (" "); Converts floating-point number you gave me I have a look, make sure to convert the string is a number, such as 123.5

CodePudding user response:

Try the Text (). The Trim ();

CodePudding user response:

Float. Parse (" ")

You input is not floating point data types,

You can use the float. TryParse (string, out float) method

Or a float. The IsNaN method

CodePudding user response:

Assigned to the value type, the best is to assess the legal
  • Related