note 58313 added to function.round
| From: | richduncan at insecureinc dot com | Date: | Mon, 31 Oct 2005 10:41:26 +0000 |
| Subject: | note 58313 added to function.round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97872@lists.php.net to get a copy of this message | ||
I've been writing a poll script and using round() to round my percentages to the nearest
integer.
$percentage_a = round($poll['option1'] / $poll['total']*100, 0);
This works fine when the script is standalone but when I implement it into my website http://www.insecureinc.com it shows the percentage values with
all the numbers after the decimal point. Goto my site and cast a vote to see what i mean.
Does anyone have any idea what could be causing this without me posting all my code for my site
template ;)
----
Manual Page -- http://www.php.net/manual/en/function.round.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58313
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58313&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58313&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58313&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58313&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58313&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58313&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58313&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58313&report=yes
Search -- http://master.php.net/manage/user-notes.php