Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
38
rated 0 times [  39] [ 1]  / answers: 1 / hits: 18294  / 12 Years ago, tue, february 19, 2013, 12:00:00

I am implementing paging in JavaScript,



Now if I have total_item_count = 69 and I want 10 records per page then it should show 7 pages but it is showing 6 pages.



What I am doing:



var totalpages = 69/10 ; // it should give 7 but its giving 6 


Thanks in advance.


More From » jquery

 Answers
9

Try:



var Totalpages = Math.ceil(Total Records/ Records per Page);


Here:



var Totalpages = Math.ceil(69/10);   // gives 7

[#80141] Sunday, February 17, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
makiyac

Total Points: 470
Total Questions: 100
Total Answers: 115

Location: Botswana
Member since Sat, Jan 7, 2023
1 Year ago
;