PHP :: Bug #28228 :: number_format function bug
| Bug #28228 | number_format function bug | ||||
|---|---|---|---|---|---|
| Submitted: | 2004-04-30 02:49 UTC | Modified: | 2004-12-14 01:39 UTC | ||
| From: | bichinhoverde at spwinternet dot com dot br | Assigned: | iliaa (profile) | ||
| Status: | Closed | Package: | Math related | ||
| PHP Version: | 4CVS, 5CVS (2004-12-12) | OS: | * | ||
| Private report: | No | CVE-ID: | None | ||
[2004-04-30 02:49 UTC] bichinhoverde at spwinternet dot com dot br
Description: ------------ When I put an empty string '' as the decimal point in the number_format function, it uses the dot '.' as decimal point. The function works well for the thousands separator. Reproduce code: --------------- print number_format(1234.5678, 2, '', ''); Expected result: ---------------- 123457 Actual result: -------------- 1234.57
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2004-04-30 03:22 UTC] bichinhoverde at spwinternet dot com dot br
[2004-04-30 03:34 UTC] bichinhoverde at spwinternet dot com dot br
[2004-04-30 09:19 UTC] derick@php.net
[2004-04-30 15:26 UTC] iliaa@php.net
[2004-09-23 17:04 UTC] mark at quarella dot co dot uk
I have just discovered that: number_format(11.99, 2, FALSE, ',') which used to display 11.99 now displays 1,199 I'm not sure whether FALSE ought to be supported as a "use the default" rather than equivalent to the empty string, but surely at worst this should give: 1199 My preference, for what it's worth, is that FALSE should take the default ('.'), but '' should work better than it does? [I only have 4.3.8 to test against but no mention of this is made in the 4.3.9 release notes][2004-09-23 17:08 UTC] mark at quarella dot co dot uk
[2004-09-23 19:43 UTC] bichinhoverde at spwinternet dot com dot br
[2004-12-14 01:39 UTC] iliaa@php.net