Fungsi Putaran VBScript


Referensi VBScript Lengkap

Fungsi Round membulatkan angka.

Sintaksis

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

Contoh

Contoh 1

<%

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

%>

Output dari kode di atas akan menjadi:

24
25

Contoh 2

Cara membulatkan angka, menjaga 2 desimal:

<%

response.write(Round(24.13278,2))

%>

Output dari kode di atas akan menjadi:

24.13

Referensi VBScript Lengkap