Re: lpad question

From: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: lpad question
Date: 2002-10-25 21:24:06
Message-ID: 73309C2FDD95D11192E60008C7B1D5BB04C7410E@snt452.corp.bcbsm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--howdy:

--okay, i *think* i'm close, but i'm not sure about what
--i'm seeing as results.

--i have this:

[snip]

testdb=> select lpad(to_char(i_pd,'99999D99'),10,'0') as i_pd from t_table
limit 1;

[/snip]

and the results are:

[snip results]

i_pd
------------
0 .00
(1 row)


[/snip results]

* Why is there a gap between the lead zero and the decimals?
* Where is the docs to tell me what, exactly, this is doing?

Thanks!

-X


-----Original Message-----
From: Johnson, Shaunn

Howdy:

Running PostgreSQL 7.2.1 on RedHat Linux 7.2.

I'm trying to create a view where I lpad a numeric field with leading
zeros and keep the two digits right of the decimal. Can someone send an
example?

Thanks!

-X

Browse pgsql-general by date

  From Date Subject
Next Message Darren Ferguson 2002-10-25 21:28:11 Re: Using aggregate functions .. (a BUG?)
Previous Message Tom Lane 2002-10-25 21:04:04 Re: Using aggregate functions .. (a BUG?)