[refference]http://stackoverflow.com/questions/3395381/c-sharp-converting-a-string-containing-a-floating-point-to-an-integer
var a =(int)Convert.ToDouble("1.2");
Note if you're using comma as a number separator in your operating system, you have to use IFormatProvider:
var a =(int)Convert.ToDouble("1.2",CultureInfo.InvariantCulture.NumberFormat);
Another way to accomplish this task:
var a =int.Parse("1.2".Split('.')[0]);