Re: I need help with TO_CHAR function. Can any one help?

From: <sybrandb_at_my-deja.com>
Date: Thu, 08 Feb 2001 09:02:53 GMT
Message-ID: <95tnbr$8ci$1_at_nnrp1.deja.com>


In article <95teoh$1hq$1_at_nnrp1.deja.com>,   Ilia Sazonov <ilia_saz_at_my-deja.com> wrote:
> Absolutely agree with you in this issue. Here is another question
 about
> the same function:
>
> select length(to_char(5,'099')) from dual;
>
> i guess, i should get a value of 3, but it is 4 actually.
> The first symbol returned by to_char function in this case is <space>.
> WHY?
>
> In article <t82einf5ea5e48_at_beta-news.demon.nl>,
> "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote:
> > From the manual
> > V
> > 999V99
> > Returns a value multiplied by 10n (and if necessary, round it up),
 where n
> > is the number of 9's after the "V".
> >
> > so
> > 1* select to_char(50,'99V99') tc from dual
> > SQL> /
> >
> > TC
> > ---------
> > 5000
> > is correct and conformance with the description.
> > The result of the your mask is a string of length 4, as that doesn't
 fit it
> > returns 4 #.
> > This is expected behavior NOT a bug.
> >
> > Hth,
> >
> > Sybrand Bakker, Oracle DBA
> >
> > "G" <gennt_at_hotmail.com> wrote in message
> > news:mJag6.7760$iM6.955632_at_newsread1.prod.itd.earthlink.net...
> > > Hello all.
> > > Why I am getting four (####), instead of getting only three(###),
 when run
> > > this statement:
> > >
> > > SELECT TO_CHAR(50,'0V00') FROM DUAL;
> > > In my opinion it should show me 3(###) signs or I am wrong. Any
 one
 can
 help
> > > me or lead me why is this happening. I think it's a bug with
 TO_CHAR
> > > function.
> > >
> > > Thanks for your help
> > >
> > >
> > >
> >
> >
>
> Sent via Deja.com
> http://www.deja.com/
>
A minus sign or a space for positive numbers are *always* included. If you don't want that you need to add fm for fill mode to_char(5,'fm099')
which will use anything after fm *exactly*

Hth,

--
Sybrand Bakker, Oracle DBA

All standard disclaimers apply
------------------------------------------------------------------------


Sent via Deja.com
http://www.deja.com/
Received on Thu Feb 08 2001 - 10:02:53 CET

Original text of this message