#31877 [NEW]: PRINTF returns garbage
| From: | kalle at ok dot ee | Date: | Mon, 07 Feb 2005 21:11:26 +0000 |
| Subject: | #31877 [NEW]: PRINTF returns garbage | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-73617@lists.php.net to get a copy of this message | ||
From: kalle at ok dot ee
Operating system: linux 2.4.28
PHP version: 4.3.10
PHP Bug Type: Strings related
Bug description: PRINTF returns garbage
Description:
------------
new installation (server, apache, PHP). apache 1.3.33, PHP 4.3.10,
slackware current.
in previous server there were no problems. but now PRINTF returns total
garbage:
for example:
<?=PRINTF("%.2f", (10/4));?> returns "2.504"
<?=PRINTF("%.2f", 10.00);?> returns "10.005"
<?=PRINTF("%.2f", 10);?> returns "10.005"
<?=PRINTF("%.2f", 125.00);?> returns "125.006"
disabled all Zend extension and googled a long time. no solution for me.
dev team? any ideas?
thanks in advance!
Reproduce code:
---------------
<?=PRINTF("%.2f", (10/4));?> returns "2.504"
<?=PRINTF("%.2f", 10.00);?> returns "10.005"
<?=PRINTF("%.2f", 10);?> returns "10.005"
<?=PRINTF("%.2f", 125.00);?> returns "125.006"
Expected result:
----------------
<?=PRINTF("%.2f", (10/4));?> returns "2.50"
<?=PRINTF("%.2f", 10.00);?> returns "10.00"
<?=PRINTF("%.2f", 10);?> returns "10.00"
<?=PRINTF("%.2f", 125.00);?> returns "125.00"
--
Edit bug report at http://bugs.php.net/?id=31877&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31877&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31877&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31877&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31877&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31877&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31877&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31877&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31877&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31877&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31877&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=31877&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=31877&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31877&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31877&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31877&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31877&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31877&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31877&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31877&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31877&r=mysqlcfg