note 129719 added to function.printf
| From: | simon.patrick@cantab.net | Date: | Sat, 24 Aug 2024 11:24:59 +0000 |
| Subject: | note 129719 added to function.printf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221493@lists.php.net to get a copy of this message | ||
A few things to note about printf:
1. The definition of specifier g (or G) is often wrongly stated as being "use e or f (or E or
f), whichever results in the shorter string". The correct rule is given in the documentation
and it does not always give this result.
2. For g/G/h/H, trailing zeros after the decimal point are removed (but not a zero just after the
decimal point, in the e/E style).
3. g/G are locale-aware whether the e/E or f style is produced.
4. For b/o/x/X/u (that is, all integer styles except d) the result shown for negative values is the
twos complement form of the number, 2**32 + v, where v is the (negative) value.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 85.255.234.41)
----
Manual Page -- https://php.net/manual/en/function.printf.php
Edit -- https://main.php.net/note/edit/129719
Del: integrated -- https://main.php.net/note/delete/129719/integrated
Del: useless -- https://main.php.net/note/delete/129719/useless
Del: bad code -- https://main.php.net/note/delete/129719/bad+code
Del: spam -- https://main.php.net/note/delete/129719/spam
Del: non-english -- https://main.php.net/note/delete/129719/non-english
Del: in docs -- https://main.php.net/note/delete/129719/in+docs
Del: other reasons-- https://main.php.net/note/delete/129719
Reject -- https://main.php.net/note/reject/129719
Search -- https://main.php.net/manage/user-notes.php