|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-11 11:16 UTC] sniper@php.net
[2006-12-22 15:30 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 06:00:02 2025 UTC |
Description: ------------ Format specifier %e (scientific number) in sprintf() function gives results with wrong number of decimal digits and in one particular case it gives a mess. Reproduce code: --------------- echo sprintf("%e\n", 1.123456789); echo sprintf("%.10e\n", 1.123456789); echo sprintf("%.0e\n", 1.123456789); // this gives a mess echo sprintf("%.1e\n", 1.123456789); echo sprintf("%5.1e\n", 1.123456789); Expected result: ---------------- 1.123457e+0 1.1234567890e+0 1e+0 1.1e+0 1.1e+0 Actual result: -------------- 1.12346e+0 1.123456789e+0 .0e+0123456789 1.e+0 1.e+0