Re: Suppress decimal point like digits in to_char?

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Suppress decimal point like digits in to_char?
Date: 2016-03-14 18:31:20
Message-ID: CA+bJJbzZtTxAfinVZbffPao9ihATXjGh6oJups8BbFfDWN-0=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi David:

On Mon, Mar 14, 2016 at 4:22 PM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

>> But a right-aligning string output routine needs to be used.
...

>> Summarising, any combination can be easily done with a single round of
>> replace.

> See also:
> http://www.postgresql.org/docs/9.5/interactive/functions-string.html
> format(formatstr text [, formatarg "any" [, ...] ])

You mean to use it to right align the replaced string ( i.e.
format('%12s',replace(...)) ) or is there a code I do not know off
which can be used to achieve the global result ( I use it but it seems
to be like a restricted sprintf which can not do the supress the zero
stuff ) ?

Francisco Olarte.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ken Tanzer 2016-03-14 18:33:53 Re: Suppress decimal point like digits in to_char?
Previous Message Frank Millman 2016-03-14 18:03:35 Re: Unexpected result using floor() function