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 1lJjhC-0003xP-H0 for pgsql-general@arkaria.postgresql.org; Tue, 09 Mar 2021 21:15:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lJjhB-0004Id-6y for pgsql-general@arkaria.postgresql.org; Tue, 09 Mar 2021 21:15:13 +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 1lJjhA-0004IU-VE for pgsql-general@lists.postgresql.org; Tue, 09 Mar 2021 21:15:12 +0000 Received: from smtp13.smtpout.orange.fr ([80.12.242.135] helo=smtp.smtpout.orange.fr) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.92) (envelope-from ) id 1lJjh4-0006ER-Au for pgsql-general@postgresql.org; Tue, 09 Mar 2021 21:15:12 +0000 Received: from X201.home ([193.252.24.13]) by mwinf5d71 with ME id eMF4240090GxKGH03MF4vV; Tue, 09 Mar 2021 22:15:05 +0100 X-ME-Helo: X201.home X-ME-Date: Tue, 09 Mar 2021 22:15:05 +0100 X-ME-IP: 193.252.24.13 Date: Tue, 9 Mar 2021 22:15:04 +0100 From: Vincent Veyron To: "David G. Johnston" Cc: pgsql-general Subject: Re: unexpected character used as group separator by to_char Message-Id: <20210309221504.309aba890549a6d4e3d16fda@wanadoo.fr> In-Reply-To: References: <20210309212821.437795da590228b5c552eead@wanadoo.fr> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 9 Mar 2021 13:33:19 -0700 "David G. Johnston" wrote: >=20 > By using "G" you are giving up control and letting your locale settings > decide what gets output. You can continue to use to_char but take control > back by being explicit, or pass actual numbers into and out of the databa= se > and let your front-end deal with presentation concerns. I suggest the > latter. Well, that was a fast answer :-) Indeed, replacing "G" with \s works. However, the application is destined t= o be multi-lingual, and number formats vary widely between countries : 1,000.25 (US) 1'000,25 (CH) 1 000,25 (FR) 1.000,25 (GER) etc... So, I intended to follow this advice by Tom Lane : https://www.postgresql-archive.org/GENERAL-setting-LC-NUMERIC-td1857521.html 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 w= riting my own parser in my front end. But this weird space is getting in my= way. --=20 Bien =E0 vous, Vincent Veyron https://marica.fr/ Logiciel de gestion des sinistres assurances, des dossiers contentieux et d= es contrats pour le service juridique