Math.Round (Vb.net)
Math.Round() function rounds the specified value of the nearest integer.
Input parameter data type
Math.Round() function accepts double and decimal as input parameter data type.
Example1
MsgBox(Math.Round(5.768))
Return Value of example1
The message box will display 6.
You can also specify the number of digits to round off after decimal place.
Example2
MsgBox(Math.Round(5.768 , 2))
Return Value of example2
The message box will display 5.77.
Example3
MsgBox(Math.Round(5.768 , 1))
Return Value of example3
The message box will display 5.8.
0 comments:
Post a Comment