WorksheetFunction.Round Method

Rounds a number to a specified number of digits.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function Round ( _
    Arg1 As Double, _
    Arg2 As Double _
) As Double
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Double
Dim Arg2 As Double
Dim returnValue As Double

returnValue = instance.Round(Arg1, Arg2)
double Round(
    double Arg1,
    double Arg2
)

Parameters

  • Arg1
    Type: System.Double

    Number - the number you want to round.

  • Arg2
    Type: System.Double

    Num_digits - specifies the number of digits to which you want to round number.

Return Value

Type: System.Double

Remarks

If num_digits is greater than 0 (zero), then number is rounded to the specified number of decimal places.

If num_digits is 0, then number is rounded to the nearest integer.

If num_digits is less than 0, then number is rounded to the left of the decimal point.

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace