i am trying to find total pages in building a pager on a website (so i want the result to be an integer. i get a list of records and i want to split into 10 per page (the page count)
when i do this:
list.Count() / 10
or
list.Count() / (decimal)10
and the list.Count() =12
, i get a result of 1
.
How would I code it so i get 2
in this case (the remainder should always add 1
)
Math.Ceiling((double)list.Count() / 10);