Round Decimals Up and Down


Nr. Round Up
Math.Ceiling(number * 100) / 100M
Round Down
Math.Floor(number * 100) / 100M
26.71026.7126.71
26.71126.7226.71
26.71226.7226.71
26.71326.7226.71
26.71426.7226.71
26.71526.7226.71
26.71626.7226.71
26.71726.7226.71
26.71826.7226.71
26.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.

Comments

Popular posts from this blog

IIS 7.5, HTTPS Bindings and ERR_CONNECTION_RESET

Table Per Hierarchy Inheritance with Column Discriminator and Associations used in Derived Entity Types

About the "The Controls collection cannot be modified because the control contains code blocks" symptom