note 11179 deleted from function.round by jeroen

From: Date: Sat, 01 Sep 2001 12:37:19 +0000
Subject: note 11179 deleted from function.round by jeroen
Groups: php.notes 
Request: Send a blank email to php-notes+get-17495@lists.php.net to get a copy of this message
Another way to roud a number with a ceiling but using a 0.05 significance is: This might be a code suggestion, since in excel this is possisble met de ceil() function. function rounder($number) { $number = round($number, 2); if(round($number,1) == $number) { return $number; } elseif(round($number,1) - $number == 0.05) { return $number - 0.05; } elseif (round($number,1) > $number) { return round($number,1); } else { return round($number,1) + 0.05; } }

« previous php.notes (#17495) next »