Round

Round a number to n decimal places.

Syntax
       Round(Expression [, NumDecimalPlaces )])

Key
   Expression        A Numeric expression

   NumDecimalPlaces  Decimal places to keep
                     1=> 12.1
                     3=> 12.123   

Example

myNum=123.4567
myNewNum=Round(myNum,2)
WScript.Echo myNewNum

“One tequila, two tequila, three tequila, floor” ~ George Carlins

Related:

Int(number) - Return the integer portion of a number
Equivalent Powershell command: $result = [math]::round(123.4567, 2)


© Copyright SS64.com 1999-2014
Some rights reserved