ID:               21801
 Comment by:       jonas at ponas dot lt
 Reported By:      supad at noos dot fr
 Status:           Closed
 Bug Type:         *Math Functions
 Operating System: Linux
 PHP Version:      4.2.2
 New Comment:

echo round(0.0445, 2);// prints 0.04


Previous Comments:
------------------------------------------------------------------------

[2003-01-21 14:10:56] [EMAIL PROTECTED]

In 4.3 both round() and number_format() round 0.5 to 1. Keep in mind
that this may also depend on your libc, which is what doing the
rounding.

------------------------------------------------------------------------

[2003-01-21 12:38:38] supad at noos dot fr

<?
echo number_format(0.49)."<br>";
echo number_format(0.50)."<br>";
echo number_format(0.51)."<br><br>";

echo round(0.49)."<br>";
echo round(0.50)."<br>";
echo round(0.51)."<br>";
?>

returns

0
0
1

0
1
1

number_format do not round correctly while round does.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21801&edit=1

Reply via email to