Doc #77451 [Opn->Ver]: %g format for printf & sprintf is misdocumented
| From: | girgias@php.net | Date: | Mon, 14 Jan 2019 04:44:34 +0000 |
| Subject: | Doc #77451 [Opn->Ver]: %g format for printf & sprintf is misdocumented | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16332@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77451&edit=1
ID: 77451
Updated by: girgias@php.net
Reported by: markamery at btinternet dot com
-Summary: %g specifier to printf is misdocumented
+Summary: %g format for printf & sprintf is misdocumented
-Status: Open
+Status: Verified
Type: Documentation Problem
-Package: Documentation problem
+Package: Strings related
-Operating System: N/A
+Operating System:
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Thanks for noticing this, you can also submit a patch to fix the documentation by using the online
editor located at https://edit.php.net
Previous Comments:
------------------------------------------------------------------------
[2019-01-12 18:26:51] markamery at btinternet dot com
Description:
------------
At http://php.net/manual/en/function.sprintf.php,
the %g specifier is documented as follows:
shorter of %e and %f.
This isn't true. %g often uses scientific notation even though it'd be shorter not to, and
what's more, its output may differ from BOTH %e and %f, since it strips trailing zeros and %f
and %e don't.
See https://stackoverflow.com/q/54162152/1709587
where I explore this point at length.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77451&edit=1