Showing posts from February, 2011

Round Decimals Up and Down

Nr. Round Up
Math.Ceiling(number * 100) / 100M Round Down
Math.Floor(number * 100) / 100M26.71026.7126.7126.71126.7226.7126.71226.7226.7126.71326.7226.7126.71426.7226.7126.71526.7226.7126.71626.7226.7126.71726.7226.7126.71826.7226.7126.71926.7226.71

Rounding Down (floor) a real number is finding the largest integer not greater than that number and Rounding Up (ceiling) a real number is finding the smallest integer not less than the number.

This table extends the classic definition of floor and ceiling to two decimals.