|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-02-14 12:44 UTC] kore@php.net
Description: ------------ There is no real category for sprintf() or string functions issues, I hope the selected one fits the issue. Between PHP 5.2.1 RC1 and PHP 5.2.1 the resulting output with the format specifier "e" changed. All PHP version prior to 5.2.1 tested by me have the same result as PHP 5.2.0. Even the tests were changed to reflect this new behavior: http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_f_2.phpt?r1=1.1.2.3&r2=1.1.2.4 Reproduce code: --------------- $ php -r 'var_dump( sprintf( "%.3e", 0.0000234 ) );' Expected result: ---------------- string(7) "2.34e-5" Actual result: -------------- string(8) "2.340e-5" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 20:00:01 2025 UTC |
That was actually a bugfix. sprintf( "%.3e", 0.0000234 ); ^^^^ it's "3 digits after the floating point" string(8) "2.340e-5" ^^^ 3 digits, not 2.