From: Ilia Alshanetsky Date: Fri, 22 Dec 2006 15:30:18 +0000 (+0000) Subject: MFB: Fixed bug #36392 (wrong number of decimal digits with %e specifier in X-Git-Tag: RELEASE_1_0_0RC1~546 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e5e31c6b8c3912a3fbefad6041c00d59bd4ca4b;p=php MFB: Fixed bug #36392 (wrong number of decimal digits with %e specifier in sprintf). --- diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index b031bc8513..11ea8454e1 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -368,9 +368,6 @@ php_sprintf_appenddouble(char **buffer, int *pos, switch (fmt) { case 'e': - if (precision) { - precision--; - } case 'E': case 'f': case 'F': diff --git a/ext/standard/tests/strings/bug36392.phpt b/ext/standard/tests/strings/bug36392.phpt new file mode 100644 index 0000000000..8e4cd16c67 --- /dev/null +++ b/ext/standard/tests/strings/bug36392.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #36392 (wrong number of decimal digits with %e specifier in sprintf) +--FILE-- + +--EXPECT-- +1.123457e+0 +1.1234567890e+0 +1e+0 +1.1e+0 +1.1e+0