Funkce kulatého jazyka VBScript


❮ Kompletní VBScript Reference

Funkce Zaokrouhlit zaokrouhlí číslo.

Syntax

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

Příklady

Příklad 1

<%

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

%>

Výstupem výše uvedeného kódu bude:

24
25

Příklad 2

Jak zaokrouhlit číslo na 2 desetinná místa:

<%

response.write(Round(24.13278,2))

%>

Výstupem výše uvedeného kódu bude:

24.13

❮ Kompletní VBScript Reference