numberOfPages = (totalResults + resultsPerPage - 1)/resultsPerPage;And, if you're interested, here's the complicated way of doing it:
pageCount = int.Parse(Math.Ceiling(Decimal.Divide(TotalCount, PageSize))); if (pageCount == 0) pageCount = 1;
C#, .Net, MVC, jQuery, JavaScript, HTML, CSS, Umbraco, Phonegap / Cordova, Xamarin, iPhone, iOS, Swift, Android, Windows, apps, websites, Full Stack, ecommerce, Facebook, responsive, front-end. Freelance developer, programmer for web and mobile in Bristol, UK.
numberOfPages = (totalResults + resultsPerPage - 1)/resultsPerPage;And, if you're interested, here's the complicated way of doing it:
pageCount = int.Parse(Math.Ceiling(Decimal.Divide(TotalCount, PageSize))); if (pageCount == 0) pageCount = 1;
dear friend thanks your great help... i've tried many option using math .round/floor/ciel but nothing gave me a proper result... and none other site where having this solution... thanks again
ReplyDelete