limit calculation output

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm a very PHP newbie, and have a stupid problem....

This is the code I have trouble with: (PHP tags removed)

round(( $number1 /  $number2 ));

The problem is that the result of the calculation can be higher than

Any number higher then 10, have to be print out as 10...

Let's say the calculation becomes 41, than it needs to be replaced by

Any suggestions?


Re: limit calculation output

Xafke wrote:
Quoted text here. Click to load it

min(round($number1 /  $number2), 10);

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: limit calculation output

Quoted text here. Click to load it


Site Timeline