You might want to take a look at System.Math.Floor and System.Math.Ceiling functions.