How to convert double into Integer?

Poster
Posted by Poster under C# category on | Views : 12218
To convert double into Integer, we can use following code snippet.

       string s = "1234501.23"; // any double value and make it as string by using ToString() like doubleValue.ToString();
double d = 0;
double.TryParse(s, out d);
int v = Convert.ToInt32(d);

Response.Write(v);

Comments or Responses

Login to post response