note 126427 added to function.sprintf
| From: | 2838132019 at qq dot com | Date: | Fri, 17 Sep 2021 01:57:23 +0000 |
| Subject: | note 126427 added to function.sprintf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216963@lists.php.net to get a copy of this message | ||
echo sprintf("%.2f", "123456789012345.82");
// result: 123456789012345.81
echo sprintf("%.2f", "123456789012345.85");
// result: 123456789012345.84
echo sprintf("%.2f", "123456789012345.87");
//result: 123456789012345.88
echo sprintf("%.2f", "123456789012345.820");
//result: 123456789012345.81
echo sprintf("%.2f", "123456789012345.821");
//result: 123456789012345.83
echo sprintf("%.2f", "123456789012345.828");
//result: 123456789012345.83
echo sprintf("%.2f", "123456789012345.8209");
//result : 123456789012345.83
echo sprintf("%.2f", "1234567890123456.82");
//result: 1234567890123456.75
echo sprintf("%.2f", "123456789012345.82002");
//result: 123456789012345.81
echo sprintf("%.2f", "123456789012345.820001");
//result: 123456789012345.81
echo sprintf("%.2f", "123456789012345.820101");
//result: 123456789012345.81
echo sprintf("%.2f", "123456789012345.820201");
//result: 123456789012345.81
echo sprintf("%.2f", "123456789012345.820301");
//result: 123456789012345.81
echo sprintf("%.2f", "123456789012345.820401");
//result: 123456789012345.83
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 113.12.172.94)
----
Manual Page -- https://php.net/manual/en/function.sprintf.php
Edit -- https://main.php.net/note/edit/126427
Del: integrated -- https://main.php.net/note/delete/126427/integrated
Del: useless -- https://main.php.net/note/delete/126427/useless
Del: bad code -- https://main.php.net/note/delete/126427/bad+code
Del: spam -- https://main.php.net/note/delete/126427/spam
Del: non-english -- https://main.php.net/note/delete/126427/non-english
Del: in docs -- https://main.php.net/note/delete/126427/in+docs
Del: other reasons-- https://main.php.net/note/delete/126427
Reject -- https://main.php.net/note/reject/126427
Search -- https://main.php.net/manage/user-notes.php