Re: Number question

From: Hilarion (hilarion_at_SPAM.op.SMIECI.pl)
Date: 09/24/04


Date: Fri, 24 Sep 2004 18:17:40 +0200


> $round_x = 5 * ceil($x/5);

Your code gives 10 as output for 6 input, where nearest 5
should be 6.

Try this:

$round_x = 5 * round( $x / 5 );

                                            Hilarion