Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24891 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21739 invoked by uid 1010); 22 Jul 2006 23:16:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21724 invoked from network); 22 Jul 2006 23:16:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2006 23:16:31 -0000 X-PHP-List-Original-Sender: toggg@php.net X-Host-Fingerprint: 212.27.42.28 smtp2-g19.free.fr Linux 2.4/2.6 Received: from ([212.27.42.28:47105] helo=smtp2-g19.free.fr) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 2B/DC-04178-EC1B2C44 for ; Sat, 22 Jul 2006 19:16:30 -0400 Received: from [192.168.0.3] (lns-bzn-54-82-251-77-248.adsl.proxad.net [82.251.77.248]) by smtp2-g19.free.fr (Postfix) with ESMTP id 443D76D00A; Sun, 23 Jul 2006 01:16:26 +0200 (CEST) Message-ID: <44C2B2E3.101@php.net> Date: Sun, 23 Jul 2006 01:21:07 +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> In-Reply-To: <00fb01c6ad81$f3b61260$0201a8c0@pc1> Content-Type: multipart/mixed; boundary="------------090803030203070104010304" Subject: Re: [PHP-DEV] [PATCH] number_format enhancements From: toggg@php.net (bertrand Gugger) --------------090803030203070104010304 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Matt W wrote: > Hi, > > 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.phpt Sorry , I did not come better than the attached test copies http://toggg.info/number_format.phpt & http://toggg.info/number_format.diff (you don't need "\n") I wonder why lines are fliping , I guess it's a diff effect Let me know how I apply your patch , so I get it blank :) -- toggg --------------090803030203070104010304 Content-Type: text/plain; name="number_format.phpt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="number_format.phpt" --TEST-- number_format() function --FILE-- --EXPECT-- Numeric string decimals 12,345 1,234.5101 Custom decimal point and thousands separator -12 345,0 -1 234,5101 No decimal point 0123 12,345,67890 Big number 10,000,000,000,000,000.00000000 Many decimals 12,345.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Minimal decimals (no trailing zeros) 9.877 -12,345 1 234.51 Thousands separator as second parameter 1235 12,345 12 345 9.876.543 --------------090803030203070104010304 Content-Type: text/plain; name="number_format.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="number_format.diff" 008+ 123 009+ 1,234,567,890 008- 0123 009- 12,345,67890 015+ 10 015- 9.877 017+ 1 235 017- 1 234.51 019+ 1,235 020+ 12,345 019- 1235 021- 12 345 022+ 9,876,543 022- 9.876.543 --------------090803030203070104010304--