DIAdem Help

Method: Round for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: Round for VBS

Rounds a number to the specified number of decimal places.

vRound = Object.Round(expression, [numdecimalplaces])
ObjectVBS
Object with this method. You do not need to specify this object.
expressionVariant
Specifies the number you want to round.
[numdecimalplaces]Variant
Specifies the number of decimal places to which the Round method rounds off. If you do not specify a value, the method rounds to integer values.
vRoundVariant
Receives the rounded number.

The following example rounds the number Pi to two decimal places:

Dim MyVar
Myvar = Round(Pi, 2) ' Pi is 3.14159265358979
Call MsgBox(MyVar)  ' Returns 3.14