Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24917 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5414 invoked by uid 1010); 24 Jul 2006 04:26:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5399 invoked from network); 24 Jul 2006 04:26:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2006 04:26:00 -0000 X-PHP-List-Original-Sender: toggg@php.net X-Host-Fingerprint: 212.27.42.36 smtp6-g19.free.fr Linux 2.4 (Google crawlbot) Received: from ([212.27.42.36:41416] helo=smtp6-g19.free.fr) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 47/A1-04178-5DB44C44 for ; Mon, 24 Jul 2006 00:25:58 -0400 Received: from [192.168.0.3] (lns-bzn-24-82-64-152-182.adsl.proxad.net [82.64.152.182]) by smtp6-g19.free.fr (Postfix) with ESMTP id A740F2253E; Mon, 24 Jul 2006 06:25:54 +0200 (CEST) Message-ID: <44C44CE4.60509@php.net> Date: Mon, 24 Jul 2006 06:30:28 +0200 Reply-To: toggg@php.net User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matt W CC: internals@lists.php.net References: <007001c6ab21$b8d560e0$0201a8c0@pc1> <00fb01c6ad81$f3b61260$0201a8c0@pc1> <44C280B7.5050504@php.net> <00e301c6ae41$dfbd7300$0201a8c0@pc1> In-Reply-To: <00e301c6ae41$dfbd7300$0201a8c0@pc1> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] number_format enhancements From: toggg@php.net (bertrand Gugger) Matt W wrote: > Hi, >>Give some basic userland examples about what you propose to change, >>please ... >>(I guess these are a part of the .phpt) > > In the .phpt file, it is userland code where you can see examples of how the > changes work. :-) Sure, but I was meaning , in so far you extend the functionality of number_format , then you will need to extend the doc. Some draft of this doc extension would be usefull , even in this test phase and especially for "userland" people. > > I'm on Windows, so I don't know how you apply the .diff to your source > download -- shouldn't diff work somehow? :-/ Well, I uploaded the full > math.c file for 5.2 and 6 if you want to grab that to replace yours > (ext/standard/math.c) and experiment with the changes. > > http://realplain.com/php/math.c-number_format_enhancements.tar.gz (5.2/6.0 > directories with the file.) I applied the patch http://realplain.com/php/number_format_enhancements_5_2.diff to the snap: [php5.2-200607222030]$ patch -p3 -b -i /home/bertrand/A/mattW/number_format/5.2/number_format_enhancements_5_2.diff No problem , I could check I get the right ext/standard/math.c by diffing whith the math.c you published in this tar.gz. $ diff ext/standard/math.c ~/A/mattW/number_format/5.2/ 981c981 < int is_negative=0, trim_dec=0; --- > int is_negative = 0, trim_dec = 0; so just a litle cleaning difference. As a note , the patch also corrected ext/standard/basic_functions.c (seperator ==> separator) which I guess is needed too :) make clean , configure , make Then , using your original .phpt : $ export TEST_PHP_EXECUTABLE=/home/bertrand/php/php5.2-200607222030/sapi/cli/php $ sapi/cli/php run-tests.php ~/A/mattW/number_format.phpt ===================================================================== CWD : /home/bertrand/php/php5.2-200607222030 PHP : /home/bertrand/php/php5.2-200607222030/sapi/cli/php PHP_SAPI : cli PHP_VERSION : 5.2.0-dev ZEND_VERSION: 2.2.0 PHP_OS : Linux - Linux ancilla.toggg.net 2.6.12-1.1381_FC3 #1 Fri Oct 21 03:46:55 EDT 2005 i686 INI actual : /usr/local/lib/php.ini More .INIs : Extra dirs : ===================================================================== Running selected tests. PASS number_format() function [/home/bertrand/A/mattW/number_format.phpt] Nice ! Just not sure if the .phpt wouldn't need some more cases ("classical" ones). > > Glad you like the idea. :-) I just hope functionality like this can be > added -- using my patch or not, or slightly different semantics... All I > want is a no extra 0's option and not be forced to include 2 unnecessary > decimal-related parameters to "get to" thousands separator when I don't want > any decimals! ;-D Actually , I was talking about the way you *propose* things , not about the things themselves. Errmmm.... not sure I'm not boring the list with such "userland" blabla, I just hope it can serve some of my "ignorant" colleagues. Cheers -- toggg