Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJjxz-0004YV-E2 for pgsql-general@arkaria.postgresql.org; Tue, 09 Mar 2021 21:32:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lJjxx-00037s-1z for pgsql-general@arkaria.postgresql.org; Tue, 09 Mar 2021 21:32:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJjxw-00037l-O0 for pgsql-general@lists.postgresql.org; Tue, 09 Mar 2021 21:32:32 +0000 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lJjxq-0006LI-5d for pgsql-general@lists.postgresql.org; Tue, 09 Mar 2021 21:32:32 +0000 Received: by mail-ot1-x32f.google.com with SMTP id e45so14290841ote.9 for ; Tue, 09 Mar 2021 13:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=2ibE1NFy+fWCd/FmS8mwRkUtqTPfpMY79McfB2D5hS0=; b=ZP9k4+ct4Gcevxa3uyt4YYRPqQIAoVpDMyOWot5rkRc7PsJ7qbL4dCoMuqRPodl67r HVTd/bB4NDzW1TGitfB+cmQJMJdVegzbgE0KSAFLq20gbrz/sB8GMkomYI1MGDzhsThG r1x5IMhJiKNt7Pa6lXVhLKjsWLZmx6sAx4qkBdefxVL0v3iR7bYsxEnPrWveTqmSZl8f 2YirYrTzw3+JcN3Ir7rPHhBpqdN7NBuROq1jT8Bw79rpa7Ysgv5XFRTJOlgYMm+K9xgx 3fPjN4ECeo3geyDBRTjKgPRKsLgn1h93xEXjqrrQVk0fXMZY6mSvybjQjqt7T9kyt4b9 RqfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=2ibE1NFy+fWCd/FmS8mwRkUtqTPfpMY79McfB2D5hS0=; b=tDwQk2J3g/F4oNNaXINVSiJix1iVJADgrrqzb++KvYp/P4JCyklTni56n5q3FWYB86 NHO0Zjwb5/wU5mXd73jqBLOWcWHSt+5thBrO9eym5JfT9t4UQwusnqD+Axy9/AooPz4U ZcLyzF3QuHMrWKEIKHPpWMo3TBNicuBtxQzyJfIJHenMHpb0Uo5ESegSEAMBfQpP/x4A RqFSAaGoakFNgYs8I8rx9FgHIoWtLSWsa/ldg7GsLBWWu2G97slW99R4DwjXDQDIo5SZ Q56b4EKh/Ab9DzkLLpEMkPHE59UUfPiD3oVGvwhiMXlzOWPZmylzl3rZU7f/gzn9EooT afZw== X-Gm-Message-State: AOAM533JOxNBIOmRf+iNThaVJ8PyN4bjiBT9d+un7x5O98GozDcLlkVi /1hrYVKg8zCqKy/w3AHZ82Qz6MRUUc8= X-Google-Smtp-Source: ABdhPJxIGbdf8PYwJ4w2Ron+v22n8zsFXbtlSRxcqiqWfAKwnITadMLXGXKTY7VHuCUsDITka36BSQ== X-Received: by 2002:a9d:3e10:: with SMTP id a16mr109770otd.261.1615325543326; Tue, 09 Mar 2021 13:32:23 -0800 (PST) Received: from ?IPv6:2601:681:5500:dde0:de1:979f:262:90d? ([2601:681:5500:dde0:de1:979f:262:90d]) by smtp.gmail.com with ESMTPSA id l4sm3089747ooq.33.2021.03.09.13.32.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Mar 2021 13:32:22 -0800 (PST) Subject: Re: unexpected character used as group separator by to_char To: pgsql-general@lists.postgresql.org References: <20210309212821.437795da590228b5c552eead@wanadoo.fr> <20210309221504.309aba890549a6d4e3d16fda@wanadoo.fr> <2044800.1615324927@sss.pgh.pa.us> From: Rob Sargent Message-ID: Date: Tue, 9 Mar 2021 14:32:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <2044800.1615324927@sss.pgh.pa.us> Content-Type: multipart/alternative; boundary="------------385095110AFEAA726B1F9CD2" Content-Language: en-CA List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------385095110AFEAA726B1F9CD2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 3/9/21 2:22 PM, Tom Lane wrote: > Vincent Veyron writes: >> Having a database with the proper lc_numeric setting for each country, and using to_char/to_number to manipulate numbers is much more appealing than writing my own parser in my front end. But this weird space is getting in my way. > The point here is that 'G' and related format codes act as specified by > your LC_MONETARY locale. If you don't like the results, you need to use > a different locale. > > (I suppose you could also use regexp_replace to convert random forms > of whitespace to plain ASCII space.) > > regards, tom lane > > I'm in David's camp on this one: there are plenty of currency format conversion libraries from which to choose. rjs --------------385095110AFEAA726B1F9CD2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 3/9/21 2:22 PM, Tom Lane wrote:
Vincent Veyron <vv.lists@wanadoo.fr> writes:
Having a database with the proper lc_numeric setting for each country, and using to_char/to_number to manipulate numbers is much more appealing than writing my own parser in my front end. But this weird space is getting in my way.
The point here is that 'G' and related format codes act as specified by
your LC_MONETARY locale.  If you don't like the results, you need to use
a different locale.

(I suppose you could also use regexp_replace to convert random forms
of whitespace to plain ASCII space.)

			regards, tom lane


I'm in David's camp on this one: there are plenty of currency format conversion libraries from which to choose. 

rjs
--------------385095110AFEAA726B1F9CD2--