Convert decimal numbers

In php i am using this to convert an decimal number to integer:




$contpag = (int) ($cont/10);



if $cont = 17 then the result that we have is 1.7 and when convert to integer is 1, but i want that the final result to integer is 2…

thanks!

:thumb:

use the ceil function :slight_smile:

http://ca.php.net/manual/en/function.ceil.php

thks it work as i want :smiley: