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

Home -> Community -> Usenet -> c.d.o.server -> Re: Retaining Trailing Zero In a Number Column?

Re: Retaining Trailing Zero In a Number Column?

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Wed, 23 Apr 2003 19:58:00 GMT
Message-ID: <MPG.19109023c5d54a8998974f@news.la.sbcglobal.net>


dave_at_simcik.com said...
> Hey group,
> This is probably a common question, but searching through the docs
> has revealed nothing. If I have a field in my table that is intended
> to be used as a price and I'm using the Number datatype [Number(8,2)],
> how can I keep the trailing zero on my prices (140.50 --> 140.5)?
>
> Any help is much appreciated.
>
> Regards,
> DTS
>

They're really there ... you just have to tell sqlplus what format to display the number in:

SQL> select 140.50 from dual;

    140.50


     140.5

1 row selected.

SQL> select to_char(140.50,'999.99') from dual;

TO_CHAR



 140.50

1 row selected.

-- 
/Karsten
DBA > retired > DBA
Received on Wed Apr 23 2003 - 14:58:00 CDT

Original text of this message

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