VBScriptラウンド関数
❮完全なVBScriptリファレンス
Round関数は、数値を丸めます。
構文
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 |
例
例1
<%
response.write(Round(24.13278) & "<br />")
response.write(Round(24.75122))
%>
上記のコードの出力は次のようになります。
24
25
例2
小数点以下2桁を保持して、数値を丸める方法:
<%
response.write(Round(24.13278,2))
%>
上記のコードの出力は次のようになります。
24.13
❮完全なVBScriptリファレンス