note 10737 added to round
| From: | kjohnson at zootweb dot com | Date: | Fri, 19 Jan 2001 17:24:16 +0000 |
| Subject: | note 10737 added to round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9975@lists.php.net to get a copy of this message | ||
Make sure you are rounding a float! User-input from a <FORM> text box is a *string*, so a
user-entered number may contain commas. If round hits a comma in a number, everything to the right
of the comma is truncated.
$test = "123,456,789.99";
echo round($test);
This displays "123".
http://www.php.net/manual/en/function.round.php