System Namespace Math Class
Returns the number nearest the specified value.
Returns the whole number nearest the specified value.
Returns the whole number nearest the specified value.
Returns the number with the specified precision nearest the specified value.
Returns the number with the specified precision nearest the specified value.
[ Visual Basic, C#, C++ ] The following code example demonstrates rounding to nearest.
NOTE: This example shows how to use one of the overloaded versions of Round. For other examples that might be available, see the individual overload topics.
[ VB ]
Math.Round ( 3.44, 1 ) 'Returns 3.4.
Math.Round ( 3.45, 1 ) 'Returns 3.4.
Math.Round ( 3.46, 1 ) 'Returns 3.5.
[ C# ]
Math.Round ( 3.44, 1 ); //Returns 3.4.
Math.Round ( 3.45, 1 ); //Returns 3.4.
Math.Round ( 3.46, 1 ); //Returns 3.5.
[ C++ ]
Math::Round ( 3.44, 1 ); //Returns 3.4.
Math::Round ( 3.45, 1 ); //Returns 3.4.
Math::Round ( 3.46, 1 ); //Returns 3.5.
Math Members