ASP 怎么能取整数有小数位自动加整数1

来源:百度知道 编辑:UC知道 时间:2024/05/28 17:02:10
round 函数ASP MOD() ?

比如:一共有1111条信息,共(1111/10=111.1)页 怎么能让结果等于112页?

这个用rs的属性pagecount就可以
rs就是recordset
rs.pagesize = 10
response.write(rs.pagecount) '就是112了

假如你要用数学的方法
dim a,b
a=1111
if a mod 10 <>0 then
b = a/10 + 1
else
b= a/10
end if

a/10+1 的值不是还是小数么?
应该这样写吧

dim a,b
a=1111
if a mod 10 <>0 then
b =(a-(a mod 10))/10 + 1
else
b= a/10
end if