Re: [PATCH] number_format enhancements
| From: | bertrand Gugger | Date: | Sat, 22 Jul 2006 22:04:30 +0000 |
| Subject: | Re: [PATCH] number_format enhancements | ||
| References: | 1 2 3 | Groups: | php.internals php.internals |
| Request: | Send a blank email to internals+get-24889@lists.php.net to get a copy of this message | ||
bertrand Gugger wrote:
Bonsoir Matt, Matt W wrote:$ wget http://snaps.php.net/php5.2-200607222030.tar.bz2 $ tar xjf php5.2-200607222030.tar.bz2 $ cd php5.2-20060722203 $ cat ../php-5.1.4/config.nice #! /bin/sh # # Created by configure './configure' \ '--with-zlib' \ '--without-pear' \ '--without-xmlrpc' \ '--program-suffix=5' \ '--enable-cli' \ '--disable-cgi' \ '--enable-memory-limit' \ "$@" $ ./configure < ../php-5.1.4/config.nice $ make $ sapi/cli/php run-tests.php ~/A/mattW/number_format.phpt which naturally failed $ cat ~/A/mattW/number_format.diff 010+ 123 011+ 1,234,567,890 010- 0123 011- 12,345,67890 020+ 10 020- 9.877 022+ 1 235 022- 1 234.51 025+ 1,235 026+ 12,345 025- 1235 027- 12 345 028+ 9,876,543 028- 9.876.543 I hope these are tests , sorry for the userland phrasing. I guess target is test does not fail. à+ -- togggHi, Haven't heard any opinions on these functionality changes... (Though I know more significant things keep you busy!) Do many other people use number_format()?? Wouldn't allowing thousands separator as param #2 simplify things? Any issues with the semantics of operation? Negative precision to specify trailing zero removal seems fine at least, even though that's different than round()'s behavior. I've now made some tests, including changes of course, in case you were just waiting for them? Hope they're enough. http://realplain.com/php/number_format.phptI did not look into that .phpt link I belong only to userland , so have less to tell here. Give some basic userland examples about what you propose to change, please ... (I guess these are a part of the .phpt) Bravo for the way you propose things. I did :