Usually, how many pages are you needed to tell the user in the list page, the following is the simplest method, at least I can think of ^ - ^:
Totalpage = (count globalconst .page_size -1) / globalconst .page_size;
Where COUNT is the current total number of records.