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

Home -> Community -> Usenet -> c.d.o.misc -> Re: decimal precision to string

Re: decimal precision to string

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 7 May 2007 13:06:52 -0700
Message-ID: <1178568412.178464.135660@p77g2000hsh.googlegroups.com>


On May 7, 3:52 pm, jobs <j..._at_webdos.com> wrote:
> new to Oracle.
>
> function output is number and produces things like this
>
> 100
> 19.95
> 19.0005
> .00625
> 3.1
>
> I need outputs to be reformated to format out into char(5), no decimal
> point rounded to hundreth decial.. looking like this?
> 10000
> 01995
> 01900
> 00001
> 00310

Try something like:
 select to_char(round(19.0005 * 100, 3),'00009') from dual;

TO_CHA



 01900

though i am not sure I got the rounding right. I do not think your description of what you want and the example match up. All your results are the number * 100 except for the .00625 one.

HTH -- Mark D Powell -- Received on Mon May 07 2007 - 15:06:52 CDT

Original text of this message

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