An Option for Rounding
The Math.Round function in Visual Studio 2005 got a slight make over. If you recall, in VS 2003 Math.Round always implemented the 'bankers rounding' which was if the number was at the half way point between an even an odd number it would always round to the even number. i.e. 2.5 rounded to 2 and 3.5 rounded to 4. This was obviously a bit confusing and unexpected to a lot of programmers with math backgrounds and not banker backgrounds, as in math you expect it to always round up if the decimal was at the half-way point.
In VS 2005 you can now specify with a parameter whether you want to round with the bankers method or the mathematical. The Round method now has an overload allowing a MidpointRounding enumeration for you to specify. The options for the enumeration are ToEven and AwayFromZero. Away from zero will always force rounding of a number at the half way point to round to the next higher number away from zero (i.e. -3.5 goes to -4 and 3.5 goes to 4). If you don't use the overload then the method continues to work in the bankers rounding mode so make sure if you are porting code from 2003 to 2005 to change your Round method to utilize the overload in the proper scenarios.