note 43864 added to function.round

From: Date: Tue, 06 Jul 2004 18:08:42 +0000
Subject: note 43864 added to function.round
Groups: php.notes 
Request: Send a blank email to php-notes+get-72782@lists.php.net to get a copy of this message
a simpler solution to the 'round to a half' method suggested by monte at ispi dot net, below. This version returna the actual number. <?php $actual_value = 3.45; // 3.45 $temp1 = $actual_value * 2; // 6.9 $temp2 = round($actual_value, 0); // 7 $half_round = $temp2 / 2 // 3.5 ?> ---- Manual Page -- http://www.php.net/manual/en/function.round.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43864 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43864&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43864&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#72782) next »