So, I have a list of items and I want to check how many pages I would need if I want to show , say, 10 items per page
ie
220 should give me 22 pages
134 should give me 14 pages
I am using the ceiling function to get the number of pages
var pages = parseInt(items)/10;
alert("pages " +pages);
alert(Math.ceil(pages));
The problem which I am having is if I have 7 items, I am expecting it to give me 1 page. However, I don't get any output. I have noticed that I only get an output if the value for pages from
var pages = parseInt(items)/10;
is greater than 1 , How do I fix this problem?