From: Vincent Veyron <vv.lists@wanadoo.fr>
To: pgsql-general <pgsql-general@postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: unexpected character used as group separator by to_char
Date: Wed, 10 Mar 2021 00:03:45 +0100
Message-ID: <20210310000345.2244070de113915b39ae2fca@wanadoo.fr> (raw)
In-Reply-To: <2044800.1615324927@sss.pgh.pa.us>
References: <20210309212821.437795da590228b5c552eead@wanadoo.fr>
<CAKFQuwZsE5riw9cTED_uXmWHq1VYkSoGU9BZRwVb8aOvexGUWg@mail.gmail.com>
<20210309221504.309aba890549a6d4e3d16fda@wanadoo.fr>
<2044800.1615324927@sss.pgh.pa.us>
On Tue, 09 Mar 2021 16:22:07 -0500
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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.
This is a numeric(10,2) type field though. I tried casting it to money type, with lc_monetary set to "fr_FR.UTF-8", same weird space
>
> (I suppose you could also use regexp_replace to convert random forms
> of whitespace to plain ASCII space.)
No dice. 'G' formatting looks like a whitespace, but is different (it appears to be slightly narrower when displayed in html, too) :
select regexp_replace(to_char(1234.56, 'FM999 990D00'), E'[\\s]', 'x');
regexp_replace
----------------
1x234,56
(1 row)
select regexp_replace(to_char(1234.56, 'FM999G990D00'), E'[\\s]', 'x');
regexp_replace
----------------
1 234,56
(1 row)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: vv.lists@wanadoo.fr, tgl@sss.pgh.pa.us
Subject: Re: unexpected character used as group separator by to_char
In-Reply-To: <20210310000345.2244070de113915b39ae2fca@wanadoo.fr>
References: <20210309212821.437795da590228b5c552eead@wanadoo.fr> <CAKFQuwZsE5riw9cTED_uXmWHq1VYkSoGU9BZRwVb8aOvexGUWg@mail.gmail.com> <20210309221504.309aba890549a6d4e3d16fda@wanadoo.fr> <2044800.1615324927@sss.pgh.pa.us> <20210310000345.2244070de113915b39ae2fca@wanadoo.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox