Browse Source

Fixed bug #36392 (wrong number of decimal digits with %e specifier in

sprintf).
experimental/5.2-WITH_DRCP
Ilia Alshanetsky 20 years ago
parent
commit
f40ebf4171
  1. 3
      NEWS
  2. 3
      ext/standard/formatted_print.c
  3. 16
      ext/standard/tests/strings/bug36392.phpt

3
NEWS

@ -16,7 +16,6 @@ PHP NEWS
__inet_pton() and inet_ntop() was named __inet_ntop(). (Hannes)
- Fixed the validate email filter so that the letter "v" can also be used in
the user part of the email address. (Derick)
- Fixed bug #39903 (Notice message when executing __halt_compiler() more than
once). (Tony)
- Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc). (Ilia)
@ -31,6 +30,8 @@ PHP NEWS
- Fixed bug #39815 (SOAP double encoding is not locale-independent). (Dmitry)
- Fixed bug #39685 (iconv() - undefined function). (Hannes)
- Fixed bug #38852 (XML-RPC Breaks iconv). (Hannes)
- Fixed bug #36392 (wrong number of decimal digits with %e specifier in
sprintf). (Matt,Ilia)
14 Dec 2006, PHP 5.2.1RC1
- Added a meta tag to phpinfo() output to prevent search engines from indexing

3
ext/standard/formatted_print.c

@ -229,9 +229,6 @@ php_sprintf_appenddouble(char **buffer, int *pos,
switch (fmt) {
case 'e':
if (precision) {
precision--;
}
case 'E':
case 'f':
case 'F':

16
ext/standard/tests/strings/bug36392.phpt

@ -0,0 +1,16 @@
--TEST--
Bug #36392 (wrong number of decimal digits with %e specifier in sprintf)
--FILE--
<?php
echo sprintf("%e\n", 1.123456789);
echo sprintf("%.10e\n", 1.123456789);
echo sprintf("%.0e\n", 1.123456789);
echo sprintf("%.1e\n", 1.123456789);
echo sprintf("%5.1e\n", 1.123456789);
?>
--EXPECT--
1.123457e+0
1.1234567890e+0
1e+0
1.1e+0
1.1e+0
Loading…
Cancel
Save