VBScript Round Functie

Definitie en gebruik

De Round-functie kan cijfers afronden.

Syntaxis

Round(expression[,numdecimalplaces])
Parameters Beschrijving
expression Verplicht. De expressie die moet worden afgerond.
numdecimalplaces Optioneel. Bepaalt hoeveel decimalen er naar boven wordt afgerond na de komma. Standaard is 0.

Voorbeeld

Voorbeeld 1

dim x
x=24.13278
document.write(Round(x))

Uitvoer:

24

Voorbeeld 2

dim x
x=24.13278
document.write(Round(x,2))

Uitvoer:

24.13