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: Function TO_CHAR

Re: Function TO_CHAR

From: Peter van Rijn <p.vanrijnRM_at_THISzhew.nl>
Date: Thu, 4 Nov 2004 11:25:30 +0100
Message-ID: <10ok0kv85f19p1c@corp.supernews.com>


>>
>> Do you know why there is the blankspace?
>>
>> Thanks
>>
>>
>
> Because it is documented that way. :-)
>
>
> From SQL-Reference:
>
> "Element Example Description"
> "9 9999 Returns value with the specified number of
> digits with a leading space if positive or with a leading minus if
> negative."
>
>
> The leading space is not specifically being caused by the "0", but by the
> "9" format in general.
>
>
> Peter
>

I forgot to mention why the space is NOT there when you don't use a format model.
This too is true because it is documented that way. :D From the SQL Reference:

"TO_CHAR converts n of NUMBER datatype to a value of VARCHAR2 datatype, using the optional number format fmt. If you omit fmt, n is converted to a VARCHAR2 value exactly long enough to hold its significant digits"

regards,
Peter Received on Thu Nov 04 2004 - 04:25:30 CST

Original text of this message

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