int.TryParse not working

asp.net, c#

Solution

Use the second `TryParse` overload that allows you to specify `NumberStyle` parameters to allow for decimals.

int val =0;
var parsed = int.TryParse("24000.0000", 
                NumberStyles.Number, 
                CultureInfo.CurrentCulture.NumberFormat, 
                out val);

Problem

My code is like this ``` string asd = "24000.0000"; int num2; if (int.TryParse(asd, out num2)) { // It was assigned. } ``` Now code execution never enters to if case, that means try parse is not working. Can any one tell me whats wrong with the code. Note:In first step The value 24000.0000 is purposefully assigned as string .

Original source