Re: Round help needed

From: Date: Sat, 29 Sep 2012 03:39:02 +0000
Subject: Re: Round help needed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-319298@lists.php.net to get a copy of this message
On 9/27/2012 10:05 PM, Chris Payne wrote:
Hi everyone, I'm having one of those nights where nothing is working, please help What I have is this: $rounded_number = round($test, -3); Here's the problem i'm having, I need it to increment to the nearest 1000 but it seems to only work if the number is over 500. For example: 123666 WILL round to 124000 BUT if I put 123085 (As an example) it doesn't round it, it just stays at 123085 - I know it's probably something totally ridiculously simple but i'm having a mental block tonight. Any help would really be appreciated. Chris http://www.youtube.com/user/zoolook3264 I just tried it here - http://ideone.com/0icSG and it seems to work fine.


« previous php.general (#319298) next »