Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Forcing 2 Decimal Positions
That's funny, the 00 works for me. See example below (note that my decimal
parameter is "," not "." because of my local settings)
SQL> select
2 price, 3 to_char (price, '90D00') as price24 from
6 union all 7 select 20 / 3 as price from dual 8 union all 9 select 20 / 8 as price from dual 10 union all 11 select 20 / 16 as price from dual 12 union all 13 select 20 / 32 as price from dual14 ) ;
PRICE PRICE2
--------- ------
20 20,00 6,6666667 6,67 2,5 2,50 1,25 1,25 ,625 0,63
-----Original Message-----
I know this must be extremely simple, but the only thing I can find for this is column format and that doesn't work, so could someone tell me how to force an amount field to show 2 decimal positions? I have tried format 999.99 and 990.00 but it will not print the zero if it is after the decimal ( i.e. 100.5 or 88 ). I know I have done this before but I guess I have gone brain dead.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Jacques Kilchoer
INET: Jacques.Kilchoer_at_quest.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Mar 12 2003 - 13:35:03 CST
![]() |
![]() |