# Calculate number of pages in image gallery?

**URL:** <https://forum.kirupa.com/t/calculate-number-of-pages-in-image-gallery/272817>\
**Category:** flash\
**Created:** [October 8, 2008, 5:37pm UTC](https://forum.kirupa.com/t/calculate-number-of-pages-in-image-gallery/272817 "2008-10-08T17:37:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![artheus](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@artheus](https://forum.kirupa.com/u/artheus)\
**Post date:** [October 8, 2008, 5:37pm UTC](https://forum.kirupa.com/t/calculate-number-of-pages-in-image-gallery/272817/1 "2008-10-08T17:37:32Z")

</div>

hey!

I’ve made a Image gallery in as3, where it loads images externally, through php and xml.  
The images are displayed 12 per page. But because of that I will later upload pictures with php, and will not care about changing anything in the actionscript, I will need to calculate how many pages there will be in my Image gallery.

Let’s say… I have 47 pictures in my database, and I will display these through flash, 12 images per page… “47/12 = ~3,9167” wich does not really return the the number of pages wich would be 4, right? so what do I do?

Thank’s for any help!

Cheers!

//Artheus
