title: Calculate number of pages using PHP Maths and Round
body: <p>I have a given number of potential posts. We don't know how many there are but the system is set up to show 12 per page. Along the bottom I would like it to display the number of pages.</p>
  
  <p>So first if we get the posts:</p>
  
  <pre><code>&lt;?php $pages =  get_posts('category_name=news'); ?&gt;
  </code></pre>
  
  <p>Now what we want to do is </p>
  
  <ol>
  <li>work out how many posts it has found</li>
  <li>divide that number by 12</li>
  <li>round that number up to the nearest whole number (UP never down)</li>
  <li>divide that number by 1 and give how many times 1 goes into it.</li>
  <li>thus giving as many page numbers as needed.</li>
  </ol>
  
  <p>The ideas is to have them lined up as 1 | 2 | 3 | 4 | 5 etc..</p>
  
  <p>Any ideas?</p>