pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fontana Daniel C. \(Desartec S.R.L.\) <desartecsrl@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: function to_char
Date: Sat, 17 Apr 2021 11:09:53 -0400
Message-ID: <256548.1618672193@sss.pgh.pa.us> (raw)
In-Reply-To: <001b01d7339a$c42a84e0$4c7f8ea0$@gmail.com>
References: <001b01d7339a$c42a84e0$4c7f8ea0$@gmail.com>

"Fontana Daniel C. \(Desartec S.R.L.\)" <desartecsrl@gmail.com> writes:
> Example, select length (to_char (1, '990'))
> returns 4 because?

Per the fine manual:

    * If no explicit provision is made for a sign in to_char()'s pattern,
      one column will be reserved for the sign, and it will be anchored to
      (appear just left of) the number. If S appears just left of some
      9's, it will likewise be anchored to the number.

If you don't want to leave space for a sign, it looks like FM is
the only way to do that.

			regards, tom lane





view thread (2+ messages)

Message-ID: <256548.1618672193@sss.pgh.pa.us>
Permalink:  ../256548.1618672193@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/256548.1618672193@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, desartecsrl@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: function to_char
  In-Reply-To: <256548.1618672193@sss.pgh.pa.us>

* 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