title: pagination calculation algorithm
body: <p>I am trying to calculate pagination:</p>
  
  <pre><code>var pagination = {
   total: result.length,
   per_page: itemsPerPage,    // required
   current_page: currentPage, // required
   last_page: users.length / itemsPerPage,    // required
   from: (itemsPerPage * pageNumber) + 1,
   to: itemsPerPage * (pageNumber + 1)           //required
  };
  </code></pre>
  
  <p>Let say the result length is 2, itemsPerPage is 5, currentPage is 1, I got this:</p>
  
  <pre><code>total: 2
  per_page: 5
  current_page: 1
  last_page: 0.4
  from: 6
  to: 10
  </code></pre>
  
  <p>I think something is not right.</p>