Re: to_char() Question - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: to_char() Question
Date
Msg-id 20051214180938.GA20046@wolff.to
Whole thread Raw
In response to Re: to_char() Question  (Terry Lee Tucker <terry@esc1.com>)
Responses Re: to_char() Question
List pgsql-general
On Tue, Dec 13, 2005 at 11:30:36 -0500,
  Terry Lee Tucker <terry@esc1.com> wrote:
>
> On Tuesday 13 December 2005 11:20 am, John Sidney-Woollett saith:
> > Not sure if there is a numeric formatting option that allows what you want.
> >
> > But how about?
> >
> > substr(to_char(1029, '9,999'),2)
>
> That's so simple, I'm embarrased ;o)
>
> Thanks for the help...

You can also us 'FM' to get rid of extra space. From the to_char docs:
FM suppresses leading zeroes and trailing blanks that would otherwise be added
to make the output of a pattern be fixed-width.

pgsql-general by date:

Previous
From: Chris Browne
Date:
Subject: Re: Release 8.1.1 for Fedora X 64bits
Next
From: Terry Lee Tucker
Date:
Subject: Re: to_char() Question