Bug #13011: formatting numbers
| From: | dcaylor at maf dot org | Date: | Wed, 29 Aug 2001 00:45:30 +0000 |
| Subject: | Bug #13011: formatting numbers | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-64549@lists.php.net to get a copy of this message | ||
From: dcaylor@maf.org
Operating system: Linux 7.1
PHP version: 4.0.4pl1
PHP Bug Type: Feature/Change Request
Bug description: formatting numbers
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 bug report at: http://bugs.php.net/?id=13011&edit=1