View previous topic :: View next topic |
Author |
Message |
Celeste Locklin Beginner
Joined: 04 May 2006 Posts: 26 Topics: 10 Location: USA
|
Posted: Thu Jun 30, 2011 7:07 pm Post subject: Display decimal |
|
|
my table field is defined as PMT_AMT DECIMAL(11,2)
when i select it, i want it to appear in my output formatted as 00000000000.00
i have tried cast(PMT_AMT) & get a hex display
digits(PMT_AMT) & get 0000000000000
decimal . . . & get a hex display
how can i do this?
thanks in advance |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Jun 30, 2011 7:53 pm Post subject: |
|
|
Celeste Locklin,
Did you try CHAR(PMT_AMT DECIMAL) ?
Kolusu |
|
Back to top |
|
|
Celeste Locklin Beginner
Joined: 04 May 2006 Posts: 26 Topics: 10 Location: USA
|
Posted: Fri Jul 01, 2011 11:42 am Post subject: |
|
|
brilliant ! but it turns out to be
CHAR(PMT_AMT) DECIMAL
000000412.80
now how do i suppress those leading zeros ? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Jul 01, 2011 12:22 pm Post subject: |
|
|
Celeste Locklin wrote: | now how do i suppress those leading zeros ? |
try
Code: |
SUBSTR(CHAR(PMT_AMT),1,1) ||
STRIP(SUBSTR(CHAR(PMT_AMT),2,12),L,'0')
|
Kolusu |
|
Back to top |
|
|
Celeste Locklin Beginner
Joined: 04 May 2006 Posts: 26 Topics: 10 Location: USA
|
Posted: Fri Jul 01, 2011 1:19 pm Post subject: |
|
|
amazing. |
|
Back to top |
|
|
|
|