Re: unexpected character used as group separator by to_char

2021-03-10 Thread Alvaro Herrera
On 2021-Mar-10, Gavan Schneider wrote: > On 10 Mar 2021, at 16:24, Alvaro Herrera wrote: > > > That space (0xe280af) is U+202F, which appears to be used for French and > > Mongolian languages (exclusively?). It is quite possible that in the > > future some other language will end up using some

Re: unexpected character used as group separator by to_char

2021-03-10 Thread Vincent Veyron
On Wed, 10 Mar 2021 02:24:57 -0300 Alvaro Herrera 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 wrote: > In any case, you could force the issue with a pattern like

Re: unexpected character used as group separator by to_char

2021-03-10 Thread Gavan Schneider
On 10 Mar 2021, at 16:24, Alvaro Herrera wrote: That space (0xe280af) is U+202F, which appears to be used for French and Mongolian languages (exclusively?). It is quite possible that in the future some other language will end up using some different whitespace character, possibly breaking any

Re: unexpected character used as group separator by to_char

2021-03-10 Thread Laurenz Albe
On Tue, 2021-03-09 at 21:28 +0100, Vincent Veyron wrote: > I'm having a problem with to_char() inserting unexpected characters as group > separator. > > For the record below, I wish to display 'credit' properly formated in an html > form, using to_char(credit, 'FM999G990D00') > > SELECT *,

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Alvaro Herrera
On 2021-Mar-10, Vincent Veyron wrote: > On Tue, 09 Mar 2021 16:22:07 -0500 > Tom Lane wrote: > > (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

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Tom Lane
Vincent Veyron writes: > Tom Lane wrote: >> (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) :

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Rob Sargent
On 3/9/21 4:03 PM, Vincent Veyron wrote: No dice. 'G' formatting looks like a whitespace, but is different (it appears to be slightly narrower when displayed in html, too) : An "n-space", no?

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Vincent Veyron
On Tue, 09 Mar 2021 16:22:07 -0500 Tom Lane 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

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Rob Sargent
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.

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Tom Lane
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

Re: unexpected character used as group separator by to_char

2021-03-09 Thread Vincent Veyron
On Tue, 9 Mar 2021 13:33:19 -0700 "David G. Johnston" wrote: > > 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 database >

Re: unexpected character used as group separator by to_char

2021-03-09 Thread David G. Johnston
On Tue, Mar 9, 2021 at 1:28 PM Vincent Veyron wrote: > For the record below, I wish to display 'credit' properly formated in an > html form, using to_char(credit, 'FM999G990D00') > > ^ > What can I do to get a standard space as group separator for

unexpected character used as group separator by to_char

2021-03-09 Thread Vincent Veyron
Hi, I'm having a problem with to_char() inserting unexpected characters as group separator. For the record below, I wish to display 'credit' properly formated in an html form, using to_char(credit, 'FM999G990D00') SELECT *, to_char(credit, 'FM999G990D00') as yo from tblprospect_balance where