#21913 [NEW]: formatting for sci notation

From: Date: Tue, 28 Jan 2003 01:30:52 +0000
Subject: #21913 [NEW]: formatting for sci notation
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-31403@lists.php.net to get a copy of this message
From: sprice@wisc.edu Operating system: Mac OS X.2.3 PHP version: 4.3.0 PHP Bug Type: Feature/Change Request Bug description: formatting for sci notation I humbly request that scientific notation formatting (ex. 7.16e-11) is added to the function sprintf(). Currently I am using a function supplied by another user: function sci($x, $d=-1) { $e=floor(log10($x)); $x*=pow(10,-$e); $fmt=($d>=0)?".".$d:""; $e=($e>=0)?"+".sprintf("%02d",$e):"-".sprintf("%02d",-$e); return sprintf("%".$fmt."fe%s",$x,$e); } and can be found in the comments of this page: http://www.php.net/manual/en/function.sprintf.php This function seems to be working fine for the time being, but this seems like somethine many other people would use and an addition to PHP itself would be better. -- Edit bug report at http://bugs.php.net/?id=21913&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21913&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21913&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21913&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21913&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21913&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21913&r=support Expected behavior: http://bugs.php.net/fix.php?id=21913&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21913&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21913&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21913&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21913&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21913&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21913&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21913&r=gnused

« previous php.bugs (#31403) next »