Re: unexpected character used as group separator by to_char

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Vincent Veyron <vv.lists@wanadoo.fr>
Cc: pgsql-general <pgsql-general@postgresql.org>
Date: 2021-03-09T20:33:19Z
Lists: pgsql-general
On Tue, Mar 9, 2021 at 1:28 PM Vincent Veyron <vv.lists@wanadoo.fr> 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 my numbers?
>

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
and let your front-end deal with presentation concerns.  I suggest the
latter.

David J.