分页算法

方法一

//总页数=(总记录数+每页行数-1)/每页行数
intPageCount = (intRowCount+intPageSize-1) / intPageSize;

 

方法二

//总记录数与每页显示记录数求余运算,计算总页数

setTotalpage(this.totalrecord % this.maxresult == 0 ? this.totalrecord / this.maxresult : this.totalrecord / this.maxresult + 1);

原文地址:https://www.cnblogs.com/tc310/p/10620229.html