Bug #13011 Updated: formatting numbers

From: Date: Mon, 17 Jun 2002 17:55:27 +0000
Subject: Bug #13011 Updated: formatting numbers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-10891@lists.php.net to get a copy of this message
ID: 13011 Updated by: hholzgra@php.net Reported By: dcaylor@maf.org Status: Open Bug Type: Feature/Change Request Operating System: Linux 7.1 PHP Version: 4.0.4pl1 New Comment: sounds like good old BASICs "PRINT USING ..." ? Previous Comments: ------------------------------------------------------------------------ [2001-08-28 20:45:30] dcaylor@maf.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/?id=13011&edit=1

« previous php.bugs (#10891) next »