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   

Examples

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

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

Related VBScript commands

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


 
Copyright © 1999-2024 SS64.com
Some rights reserved