Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: select question

RE: select question

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Thu, 31 May 2001 14:12:59 -0700
Message-ID: <F001.00316E55.20010531132642@fatcity.com>

> -----Original Message-----
> From: Ron Rogers [mailto:RROGERS_at_galottery.org]
>
> If you know the size of the number (in position count not
> value) you can use the RPAD(sum(field),count,0) to populate
> the right end of the return value to zero. 
> ex. the sum value is = 2.5 and you want 2.50
> rpad(sum(fd1,4,'0') return 2.50
>
> BUT if the return value = 25.5 and you want 25.50 and have
> used the 2.50 rpad(sum(fd1,4,'0')  the return 25.5  will be
> returned. You could always use
> 2.50 rpad(sum(fd1,6,'0') and then drop the unneeded zeroes.

Am I missing something? Why not use to_char (number_field, '99.99')? or to_char (number_field, 'FM99.99') to eliminate leading and trailing blanks in the formatted number Received on Thu May 31 2001 - 16:12:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US