Fonction d' arrondi VBScript


❮ Référence complète de VBScript

La fonction Round arrondit un nombre.

Syntaxe

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

Exemples

Exemple 1

<%

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

%>

La sortie du code ci-dessus sera :

24
25

Exemple 2

Comment arrondir un nombre en gardant 2 décimales :

<%

response.write(Round(24.13278,2))

%>

La sortie du code ci-dessus sera :

24.13

❮ Référence complète de VBScript