Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alter function ceil per floor in updateNumPages #11

Open
thadeu opened this issue May 10, 2016 · 1 comment
Open

alter function ceil per floor in updateNumPages #11

thadeu opened this issue May 10, 2016 · 1 comment

Comments

@thadeu
Copy link

thadeu commented May 10, 2016

protected function updateNumPages(){
$this->numPages = ($this->itemsPerPage == 0 ? 0 : (int) floor($this->totalItems/$this->itemsPerPage));
}

@bhhaskin
Copy link

bhhaskin commented Mar 7, 2017

If you round down wouldn't you need up with orphan items?

Example: lets say we have 25 items with 10 items per page.

if we use floor we would round 2.5 down to 2 pages, leaving 5 items orphaned.

if we use ceil we would round 2.5 up to 3 pages, making sure that the last 5 items are not orphaned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants