note 92124 added to function.sprintf
| From: | JohnWalker at osu1 dot php dot net | Date: | Fri, 10 Jul 2009 00:56:38 +0000 |
| Subject: | note 92124 added to function.sprintf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-158126@lists.php.net to get a copy of this message | ||
To add to other notes below about floating point problems, I noted that %f and %F will apparently
output a maximum precision of 6 as a default so you have to specify 1.15f (eg) if you need more.
In my case, the input (from MySQL) was a string with 15 digits of precision that was displayed with
6. Likely what happens is that the rounding occurs in the conversion to a float before it is
displayed. Displaying it as 1.15f (or in my case, %s) shows the correct number.
----
Server IP: 66.207.199.35
Probable Submitter: 174.7.25.37
----
Manual Page -- http://www.php.net/manual/en/function.sprintf.php
Edit -- https://master.php.net/note/edit/92124
Del: integrated -- https://master.php.net/note/delete/92124/integrated
Del: useless -- https://master.php.net/note/delete/92124/useless
Del: bad code -- https://master.php.net/note/delete/92124/bad+code
Del: spam -- https://master.php.net/note/delete/92124/spam
Del: non-english -- https://master.php.net/note/delete/92124/non-english
Del: in docs -- https://master.php.net/note/delete/92124/in+docs
Del: other reasons-- https://master.php.net/note/delete/92124
Reject -- https://master.php.net/note/reject/92124
Search -- https://master.php.net/manage/user-notes.php