Converting Double to integer in C#

var pi = 3.1415926535;
var intValue = (int)pi;
//intValue is 3