Search Postgresql Archives

Re: unexpected character used as group separator by to_char

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 09 Mar 2021 16:22:07 -0500
Tom Lane <tgl@xxxxxxxxxxxxx> 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)







[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux