Re: lpad question - Mailing list pgsql-general

From Johnson, Shaunn
Subject Re: lpad question
Date
Msg-id 73309C2FDD95D11192E60008C7B1D5BB04C7410E@snt452.corp.bcbsm.com
Whole thread Raw
In response to lpad question  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Using aggregate functions .. (a BUG?)
Next
From: Darren Ferguson
Date:
Subject: Re: Using aggregate functions .. (a BUG?)