I think you should try something like this:
public int Round( int number) { int power = number.ToString().Length - 1; int sz = Math.Pow(10, power); int rounded = (int)Math.Round( number / sz ); return rounded * sz; }
The idea is to get the size of the nearest 10 power, available along the length of the number, expressed as a string. Then divide the number by this power, leaving it equal to 1.2, and then round it using the Math.Round method, and restore the size by resetting it to power.
Like the previous answer ...
source share