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: to_number and trailing spaces

Re: to_number and trailing spaces

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 28 Mar 2007 13:13:12 -0700
Message-ID: <1175112792.456519.57230@r56g2000hsd.googlegroups.com>


On Mar 28, 1:44 pm, "dmonder" <dmon..._at_gmail.com> wrote:
> Well, the two links you provided say nothing about to_number not being
> designed to return trailing spaces. In fact, one of the links from
> the oracle site
>
> http://download-east.oracle.com/docs/cd/B19306_01/olap.102/b14346/dml...
>
> gives an example showing trailing spaces.
>
> I did find in the documentation the Oracle does not store trailing
> zeros for NUMBER types, but this is output from a function that uses a
> format specifier that can specify 9D000.
>
> David
>
>
>
> fitzjarr..._at_cox.net wrote:
> > On Mar 28, 11:22 am, "dmonder" <dmon..._at_gmail.com> wrote:
> > > I am trying to get to_number to return trailing spaces using the
> > > format '9D000' but it does not. Can anyone explain to me why this is?
>
> > > David Onder
>
> > The to_number() function isn't designed to 'return trailling spaces'.
> > Stop expecting it to do so. Please read the documentation on
> > to_number():
>
> >http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/f...
>
> > Or choose which document you'd like to read:
>
> >http://www.oracle.com/pls/db102/search?remark=quick_search&word=to_nu...
>
> > David Fitzjarrell- Hide quoted text -
>
> - Show quoted text -

How can a number have traling spaces? A number can have trailing zeroes but it really should not have trailing spaces.

If you are trying to fix the width of the outputed number then what you probably want is to zero fill the leading positions.

E1 E2
------- -------
  5.000 005.00

HTH -- Mark D Powell -- Received on Wed Mar 28 2007 - 15:13:12 CDT

Original text of this message

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