Jump to content


Photo

rounding numbers up


  • Please log in to reply
2 replies to this topic

#1 scotch33

scotch33
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 20 March 2006 - 11:49 AM

Hi,

I am trying to create a calculator that will calculate the number of packs of wood needed to floor a room.

Its all working ok but my only problem is when I divide the floor space by the number of meters in a pack to calculate how many packs will be needed it is giving me a number with decimal places. I can easily change this to an integer and ditch the decimal places but how do I get it to always round up rather than down?

Thanks

John
The arrogance with which someone answers your post is usually inversely proportional to the life they have out of web forums.
(Plato - honest!)

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 20 March 2006 - 12:33 PM

Look at the [a href=\"http://www.php.net/ceil\" target=\"_blank\"]ceil[/a]() function.

Ken

#3 scotch33

scotch33
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 20 March 2006 - 06:33 PM

Thanks Ken - will do
The arrogance with which someone answers your post is usually inversely proportional to the life they have out of web forums.
(Plato - honest!)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users