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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: How to display FLOAT in 99999.999 format

RE: How to display FLOAT in 99999.999 format

From: Sarnowski, Chris <csarnows_at_CuraGen.com>
Date: Fri, 01 Aug 2003 10:59:23 -0800
Message-ID: <F001.005C8469.20030801105923@fatcity.com>

use a 0 instead of a 9 for leading/trailing zeroes.

SQL>select to_char(123.45, '999.990') from dual;

TO_CHAR(



 123.450

SQL>select to_char(123.45678, '999.990') from dual;

TO_CHAR(



 123.457

SQL>select to_char(123.45, '0999.990') from dual;

TO_CHAR(1



 0123.450

> -----Original Message-----
> From: Odland, Brad [mailto:Brad.Odland_at_qtiworld.com]
> Sent: Friday, August 01, 2003 2:39 PM
> To: Multiple recipients of list ORACLE-L
> Subject: RE: How to display FLOAT in 99999.999 format
>
>
> Tried that.
>
> 1234.1 won't show the trailing zeros...
>
>
>
> -----Original Message-----
> Sent: Friday, August 01, 2003 1:19 PM
> To: Multiple recipients of list ORACLE-L
>
>
> Not sure if this is the best way but you could do something
> like SELECT
> TO_CHAR(10000,'9999999.999') FROM DUAL;
>
> Only drawback that I have been running into is if you don't
> allot of enough
> spaces before the decimal it display a value of ########.
>
> Hope this helps.
>
> ----- Original Message -----
> To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
> Sent: Friday, August 01, 2003 12:14 PM
>
>
> > How do I force display of a FLOAT
> >
> > in a format like
> >
> > Original number Result
> > 1234.34 1234.340
> > 12345.456 12345.456
> > 123.1 123.100
> > 123 123.000
> >
> >
> > The dev on a project wants to preformat the data for a report on the
> > database side.
> >
> > He wants 3 places after the decimal to display even if the
> number is a
> whole
> > number....
> >
> > (I know most VB report controls do this easily....but...)
> >
> > I thought it was complicated as it would require a to_char
> with format
> > description then searching for the postion of the decimal
> and then moving
> > from there to the right counting the characters if the number of
> characters
> > to the right of the decimal was < 3 then pad with zeros...
> >
> > I messed around with RPAD, TRUNC, ROUND and TO_CHAR and
> found I was not
> able
> > handle all cases of possible significant digits.
> >
> > Sounded like a complicated function to do something thats
> automagic in a
> > reporting control. Or am I forgetting a oracle function....or fomat?
> >
> > This is 8.1.7....
> >
> > I told the developer to use the field formatting contols of
> his reporting
> > control because the additional zeros padded in a number are
> basically
> > meaningless in a database and mathematical operations.
> >
> > Brad O.
> >
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.net
> > --
> > Author: Odland, Brad
> > INET: Brad.Odland_at_qtiworld.com
> >
> > Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> > San Diego, California -- Mailing list and web
> hosting services
> >
> ---------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> >
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Jay
> INET: fish_dba_at_hotmail.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Odland, Brad
> INET: Brad.Odland_at_qtiworld.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

LEGAL NOTICE:
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this e-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Sarnowski, Chris
  INET: csarnows_at_CuraGen.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Aug 01 2003 - 13:59:23 CDT

Original text of this message

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