Jump to content

Archived

This topic is now archived and is closed to further replies.

scotch33

rounding numbers up

Recommended Posts

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

Share this post


Link to post
Share on other sites
Look at the [a href=\"http://www.php.net/ceil\" target=\"_blank\"]ceil[/a]() function.

Ken

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.