zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

asp取一个数的整数但不是四舍五入,只要有小数,就取大于这个数的整数

ASP 一个 这个 不是 整数 小数 大于 四舍五入
2023-06-13 09:14:13 时间
如:
0.625取1
2.1 取 3
3.6 取 4
<%
iffix(a)>athen
b=fix(a)
else
b=fix(a)+1
response.writeb
endif
%>
或者:
<%
a=0.625
ifa<>fix(a)then
a=fix(a)+1
else
a=fix(a)
endif
response.writea
%>
(注:这个测试成功!)
-------------
如果用:
<%
a=0.625
ifa<>cint(a)then
a=cint(a)+1
response.writea
endif
%>
(注:这个如果a=0.625,返回的就变成2,而不是变成1.)