Re: Number question
From: Hilarion (hilarion_at_SPAM.op.SMIECI.pl)
Date: 09/24/04
- Next message: coolsti: "Re: getting php to run as another user?"
- Previous message: coolsti: "Re: getting php to run as another user?"
- In reply to: Craig Keightley: "Re: Number question"
- Next in thread: Craig Keightley: "Re: Number question"
- Reply: Craig Keightley: "Re: Number question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: coolsti: "Re: getting php to run as another user?"
- Previous message: coolsti: "Re: getting php to run as another user?"
- In reply to: Craig Keightley: "Re: Number question"
- Next in thread: Craig Keightley: "Re: Number question"
- Reply: Craig Keightley: "Re: Number question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]