Wrox Programmer Forums
|
BOOK: Professional ASP.NET Design Patterns
This is the forum to discuss the Wrox book Professional ASP.NET Design Patterns by Scott Millett; ISBN: 978-0-470-29278-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET Design Patterns section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 7th, 2013, 08:11 AM
Registered User
 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Calculating Number of Result Pages

The following method is taken from /Agathas.Storefront.Services/Mapping/ProductMapper.cs

private static int NoOfResultPagesGiven(int numberOfResultsPerPage, int numberOfTitlesFound)
{
if (numberOfTitlesFound < numberOfResultsPerPage)
return 1;
else
{
return (numberOfTitlesFound / numberOfResultsPerPage) + (numberOfTitlesFound % numberOfResultsPerPage);
}
}

Shouldn't the logic be:
(numberOfTitlesFound / numberOfResultsPerPage) + 1;


Regards,
Bilal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Why are number of pages inconsistent? Audioicon BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 October 16th, 2008 09:02 PM
Reducing the number of Pages in a Report derekdeben Access 1 January 23rd, 2007 05:58 PM
Formating xpath function result number ronisc XSLT 4 December 20th, 2006 09:04 AM
Calculating number of days between multiple dates Vann Access 4 December 3rd, 2004 08:26 PM
Result in more pages ciko1973 Classic ASP Databases 1 July 5th, 2003 09:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.