asp.net.ph

Math.Round Method

System Namespace   Math Class


Returns the number nearest the specified value.

Overload List

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.


Example

[ 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.
See Also

Math Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph