|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-09-22 09:34 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: nikic
[2012-09-22 09:34 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 01:00:01 2025 UTC |
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.