Re: Number Format

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 8 Sep 1998 00:46:26 GMT
Message-ID: <35f95c61.39709350_at_netnews.worldnet.att.net>


On Sat, 5 Sep 1998 10:05:09 -0700, "Joe Humphreys" <jhum_at_who.net> wrote:

>However, the number of
>columns is always one more than I request. I assume this may have to do
>with reserving one space for a + or - sign. Any way to get exactly the
>number of columns I request?

Yes, it is because SQL*Plus is leaving space for the sign. Try something like this:

COLUMN number_out FORMAT A6
SELECT LTRIM(TO_CHAR(your_number,'999.99')) number_out FROM your_table;

The conversion to a character string is done within the SQL statement by using the TO_CHAR function. The LTRIM function is in turn used on that to eliminate any leading spaces. I havn't tested this specific instance, but I've done this before myself, and I think I remember it right. Let me know if you need anymore help.

regards,

Jonathan Gennick Received on Tue Sep 08 1998 - 02:46:26 CEST

Original text of this message