-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description:
The TotalPages property currently uses Math.Floor to calculate the number of pages, which results in incorrect values when the total number of items is not perfectly divisible by ItemsPerPage.
Problem:
In the current implementation:
return (int)Math.Floor((double)Total / ItemsPerPage);This will cause the result to round down, omitting the additional page required for the remaining items.
Example:
If Total = 275 and ItemsPerPage = 20:
- Expected
TotalPages= 14 (13 full pages + 1 partial) - Actual
TotalPages= 13 (incorrect)
Proposed Fix:
Replace Math.Floor with Math.Ceiling to ensure partial pages are counted correctly:
This will correctly return 14 pages for the example above.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels