VBScript Round - functie


❮Volledige VBScript-referentie

De functie Afronden rondt een getal af.

Syntaxis

Round(expression[,numdecimalplaces])

Parameter Description
expression Required. The numeric expression to be rounded
numdecimalplaces Optional. Specifies how many places to the right of the decimal are included in the rounding. Default is 0

Voorbeelden

voorbeeld 1

<%

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

%>

De uitvoer van de bovenstaande code zal zijn:

24
25

Voorbeeld 2

Hoe een getal af te ronden met 2 decimalen:

<%

response.write(Round(24.13278,2))

%>

De uitvoer van de bovenstaande code zal zijn:

24.13

❮Volledige VBScript-referentie