Req #13011 [Opn->Wfx]: formatting numbers
| From: | jani@php.net | Date: | Fri, 17 Dec 2010 12:16:25 +0000 |
| Subject: | Req #13011 [Opn->Wfx]: formatting numbers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157043@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=13011&edit=1
ID: 13011
Updated by: jani@php.net
Reported by: dcaylor at maf dot org
Summary: formatting numbers
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: Linux 7.1
PHP Version: 4.0.4pl1
Block user comment: N
Private report: N
New Comment:
As you have shown, it's very easy to achieve in userland. Not everything
and their mom need to have their own native functions and such in PHP..
Previous Comments:
------------------------------------------------------------------------
[2002-06-17 13:55:26] hholzgra@php.net
sounds like good old BASICs "PRINT USING ..." ?
------------------------------------------------------------------------
[2001-08-28 20:45:30] dcaylor at maf dot org
It would be extremely helpful to be able to do more formatting of
numbers than is currently available.
Specifically, it would be good if number_format would prepend a dollar
sign or allow negative numbers to be shown in brackets rather than with
a negative sign. Both of these are necessary for accounting
applications.
My current solution for negative currency looks like this:
if ( $value < 0 )
{
$value = "(\$".number_format(abs($value),2).")";
}
which works but is less than ideal. For one thing, it makes later use
of the number difficult.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=13011&edit=1