c# - Double.Parse("string") FormatException with correct input -


I'm trying to parse

  double. Purse (row data [j ++]).   

The input sting is correct ("7,412"), j = 123 so it worked till this point.

And even if I'm typing double. (Row data [j]) This works.

Is there a problem here?

You have a comma rather than your decimal separator

You should use allowHouse number type if it is thousands separator

  number style style = number style . Allow thousands. NumberStyles.Float; Double. Purse (value, style);   

Or you your comma. Before parsing using string.Replace with it is considered as a decimal separator

Comments

Popular posts from this blog

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

jquery - How to make a wrapper function in javascript? -

sql - PostgreSQL automatically update row at specific date -