وظيفة VBScript Round
❮ استكمال مرجع 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
كيفية تقريب رقم ، مع الاحتفاظ برقمين عشريين:
<%
response.write(Round(24.13278,2))
%>
ناتج الكود أعلاه سيكون:
24.13
❮ استكمال مرجع VBScript