Jump to content

SOLVED: If numerical variable is not whole integer, I want to always round up..


Guest kilbad

Recommended Posts

If I have a variable, let's say $numerator, and I want to divide by a constant number, let's say 4, what PHP command can I use to always round the result up, even if the resulting value is less than .5?

So for example:
$result = $numerator/4;
..in the case that $numerator=1, what could I use to round $result up to 1?

Thank you so much in advance!

Brendan

Archived

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

×
×
  • Create New...

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.