#45300 [NEW]: Bug in number format

From: Date: Wed, 18 Jun 2008 12:50:03 +0000
Subject: #45300 [NEW]: Bug in number format
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-125847@lists.php.net to get a copy of this message
From:             gernovich at ya dot ru
Operating system: win xp
PHP version:      5.2.6
PHP Bug Type:     *General Issues
Bug description:  Bug in number format

Description:
------------
Convertion problem with float types.
The problem is also affected on round() and ceil(),
but number_format() not no mathematical function.

Reproduce code:
---------------
$a = -0.014;
print round($a,1)."\n"; // -0 bogus
print number_format($a, 1)."\n"; // -0.0 bug

Expected result:
----------------
-0
0.0


Actual result:
--------------
-0
-0.0


-- 
Edit bug report at http://bugs.php.net/?id=45300&edit=1
-- 
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45300&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45300&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45300&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45300&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=45300&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45300&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45300&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45300&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45300&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45300&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=45300&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=45300&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45300&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45300&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45300&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45300&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45300&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45300&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45300&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45300&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#125847) next »