Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69460 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51939 invoked from network); 2 Oct 2013 17:57:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2013 17:57:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain oracle.com designates 141.146.126.69 as permitted sender) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 141.146.126.69 aserp1040.oracle.com Received: from [141.146.126.69] ([141.146.126.69:45563] helo=aserp1040.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/9C-23255-88E5C425 for ; Wed, 02 Oct 2013 13:57:29 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r92HvNFc001938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Oct 2013 17:57:24 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r92HvN7F015338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Oct 2013 17:57:23 GMT Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r92HvMd3015316; Wed, 2 Oct 2013 17:57:22 GMT Received: from [130.35.70.238] (/130.35.70.238) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 02 Oct 2013 10:57:22 -0700 Message-ID: <524C5E81.6030907@oracle.com> Date: Wed, 02 Oct 2013 10:57:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Nikita Popov , PHP internals References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Subject: Re: [PHP-DEV] Locale-independent double-to-string cast From: christopher.jones@oracle.com (Christopher Jones) On 10/02/2013 10:26 AM, Nikita Popov wrote: > Hi internals! > > I'd like to change our double-to-string casting behavior to be > locale-independent and would appreciate some opinions as to whether you > consider this feasible. > So, my suggestion is to change the (string) cast to always use "." as the > decimal separator, independent of locale. The patch for this is very > simple, just need to change a few occurrences of "%.*G" to "%.*H". I'd like to see float/double casts recognize the locale's decimal separator. It's perfectly fine in Oracle DB for numbers to be inserted/fetched with "," (or any other character) as the decimal separator: The output is: string(7) "123,567" float(123) // Ideally this would be 123,567 Chris -- christopher.jones@oracle.com http://twitter.com/ghrd Free PHP & Oracle book: http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html