To round rather than truncate, use Convert's numerical conversion methods:
using System; class MainClass//from www . j a v a2 s . c om { public static void Main(string[] args) { double d = 3.9; int i = Convert.ToInt32 (d); Console.WriteLine(i); } }