Skip to main content

WorksheetFunction.Round method

Rounds a number to a specified number of digits.

Syntax

expression.Round (Arg1Arg2)

expression A variable that represents a WorksheetFunction object.

Parameters

Name Required/Optional Data type Description
Arg1 Required Double Number - the number that you want to round.
Arg2 Required Double Num_digits - specifies the number of digits to which you want to round number.

Return value

Double

Remarks

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

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

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

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>