phat_hip_prog Posted July 20, 2007 Share Posted July 20, 2007 I need to round up a number, e.g. $tot = 24; $rows = 10; $npos = (integer)(($tot / $rows) + 0.5); Here the answer is '2', but i'm after '3'. How to do? Quote Link to comment Share on other sites More sharing options...
chigley Posted July 20, 2007 Share Posted July 20, 2007 ceil() Quote Link to comment Share on other sites More sharing options...
dayfox Posted July 20, 2007 Share Posted July 20, 2007 <?php $tot = 24; $rows = 10; echo round(($tot / $rows) +0.5); ?> (Returns 3) Is this what you mean? Regards Quote Link to comment Share on other sites More sharing options...
phat_hip_prog Posted July 20, 2007 Author Share Posted July 20, 2007 Looks good, cheers! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.