Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

VBScript Round function


May 13, 2021 VBScript


Table of contents


VBScript Round function

When using VBScript, if you need to round numbers, use the Round function!


VBScript Round function Complete VBScript reference manual

The Round function rounds numbers.

Grammar

Round(expression[,numdecimalplaces])

parameter describe
expression Required.Need to be rounded in numerical expression.
numdecimalplaces Optional.Specifies how many people on the right side of the decimal point are rounded.The default is 0.

Instance 1

<script type="text/vbscript">

document.write(Round(24.13278) & "<br />")
document.write(Round(24.75122))

</script>

The above example output results:

24
25

Try it out . . .

Instance 2

How to round a number to keep 2 digits:

<script type="text/vbscript">

document.write(Round(24.13278,2))

</script>

The above example output results:

24.13

Try it out . . .

VBScript Round function Complete VBScript reference manual