Edit report at http://bugs.php.net/bug.php?id=13011&edit=1
ID: 13011 Updated by: [email protected] 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] [email protected] 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
