ID: 21801 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: *Math Functions Operating System: Linux PHP Version: 4.2.2 New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [2003-01-21 12:38:38] [EMAIL PROTECTED] <? 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
