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


如:
0.625 取 1
2.1  取 3
3.6  取 4
<%
if fix(a)>a then
b=fix(a)
else
b=fix(a)+1
response.write b
end if
%>
或者:
<%
a=0.625
if a<>fix(a) then
a=fix(a)+1
else
a=fix(a)
end if
response.write a
%>
(注:这个测试成功!)
————-
如果用:
<%
a=0.625
if a<>cint(a) then
a=cint(a)+1
response.write a
end if
%>
(注:这个如果a=0.625,返回的就变成2,而不是变成1.)

—-想了解更多的linux相关异常处理怎么解决关注<计算机技术网(www.ctvol.com)!!>



本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/htmltutorial/78970.html

(0)
上一篇 2020年4月23日
下一篇 2020年4月23日

精彩推荐