note 60818 added to function.intval
| From: | anonymous at place dot com | Date: | Tue, 17 Jan 2006 17:37:32 +0000 |
| Subject: | note 60818 added to function.intval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101984@lists.php.net to get a copy of this message | ||
re: Disturbing issue with intval()
It's probably just good practice to round decimals anyways. i.e...
$amount = round(19.99 * 100);
$test2 = intVal($amount);
$test3 = intVal("$amount");
echo $test2 . "<br />\n";
echo $test3 . "<br />\n";
----
Server IP: 12.160.245.96Probable Submitter: 66.141.114.205
----
Manual Page -- http://www.php.net/manual/en/function.intval.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60818
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60818&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60818&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60818&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60818&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60818&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60818&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60818&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60818&report=yes
Search -- http://master.php.net/manage/user-notes.php