From: | Bruno Wolff III <bruno(at)wolff(dot)to> |
---|---|
To: | Terry Lee Tucker <terry(at)esc1(dot)com> |
Cc: | PG-General General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: to_char() Question |
Date: | 2005-12-14 18:09:38 |
Message-ID: | 20051214180938.GA20046@wolff.to |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, Dec 13, 2005 at 11:30:36 -0500,
Terry Lee Tucker <terry(at)esc1(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Browne | 2005-12-14 19:06:57 | Re: outdated (bad) information in pg_stat_activity |
Previous Message | Chris Browne | 2005-12-14 17:49:01 | Re: Release 8.1.1 for Fedora X 64bits |