|
Description Syntax Return
Datatype Example Migration
Round Function - Visual Basic 6.0
(VB 6.0) |
Returns a number rounded to a specified number of
decimal places. |
|
Syntax: |
Round(expression [,numdecimalplaces])
Parameter |
Description |
expression |
Required. Numeric expression being rounded. |
numdecimalplaces |
Optional. Default 0. Number indicating how many places to
the right of the decimal are included in the rounding. |
|
Return Data type: |
|
Variant (Integer, Long, Single, Double) |
Example: |
Statement |
Result |
Remark |
Round(1) |
1 |
|
|
Round(1.5) |
2 |
|
|
Round(2.5) |
2 |
Nearest Even Number |
|
Round(0.0035, 3) |
0.004 |
|
|
Round(0.0045, 3) |
0.004 |
Nearest Even Digit |
|
Round(2.5, 1) |
2.5 |
|
|
Round(1234.5678, 3) |
1234.568 |
|
|
Round(123.5678) |
124 |
|
|
Round(123.4567) |
123 |
|
|
Round("123.4567") |
123 |
|
|
Round(unknown) |
0 |
uninitialized Variable |
|
Round(Null) |
Null |
|
|
Round("abcd") |
Error |
Type mismatch |
|
Round(True) |
-1 |
True - Non Zero |
|
Round(False) |
0 |
False - Zero |
 |
|
|
Migration from Visual Basic 6.0 (VB 6.0) to |
|
Round Function in VB Script (VBS) |
|
Round Function in JScript (JS) |
|
Round Function in ASP (Active Server Page) |
|
Round Function in PHP Script |
|
Round Function in MS-Access |
|
Round Function in MS SQL Server |
|
Round Function in Oracle |
|
Round Function in C Language |
|
Round Function in C++ Language |
|
Round Function in Foxpro |
|
Round Function in Fortran |
|
Round Function in MS Excel Sheet |
 |
|
|
|
|