Re: unexpected character used as group separator by to_char

From: Vincent Veyron <vv(dot)lists(at)wanadoo(dot)fr>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Subject: Re: unexpected character used as group separator by to_char
Date: 2021-03-10 12:19:28
Message-ID: 20210310131928.fb29ee77d3dba82f4084e185@wanadoo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 10 Mar 2021 02:24:57 -0300
Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>
> That space (0xe280af) is U+202F, which appears to be used for French and
> Mongolian languages (exclusively?)

On Tue, 09 Mar 2021 18:57:05 -0500
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> In any case, you could force the issue with a pattern like '[\s\uNNNN]'
> for whatever the code point of that character is.

On Wed, 10 Mar 2021 09:41:19 +0100
Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:

> SELECT replace(to_char(2345.10, 'FM999G990D00'), E'\u202F', ' ');

Thank you all for the helpful answers, I can work with that.

Strange that to_char() and to_number() would use a different separator, though :

select to_number(to_char(1234.56, 'FM999G990D00'), 'FM999G990D00');
to_number
-----------
1234.5

select to_number(replace(to_char(1234.56, 'FM999G990D00'),E'\u202F', ' '), 'FM999G990D00');
to_number
-----------
1234.56

--
Bien à vous, Vincent Veyron

https://compta.libremen.com
Logiciel libre de comptabilité générale en partie double

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Forum Writer 2021-03-10 12:34:27 WAL-files is not removing authomaticaly
Previous Message Alban Hertroys 2021-03-10 12:08:12 How to check for existence of nested JSONB property key?