Purpose
Removes the fractional part of a number and returns the rounded value as an integer (or a long). Numbers with fractional parts greater than or equal to 0.5 will be rounded up to the nearest integer value. Numbers with fractional parts less than 0.5 will be rounded down.
Syntax
Round (NumericExpression)
NumericExpression |
Any valid numeric expression. |
Example
Sub Main()
Dim mynum As Double
Dim i as integer
For I = 1 to 20
mynum = i/10
Print "The value of 'mynum' is: "; mynum
Print "The rounded value of 'mynum' is: ";
Round(mynum)
Next i
End Sub
|