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: do not cut decimal places

Re: do not cut decimal places

From: Marek Lange <marek.lange_at_web.de>
Date: Wed, 02 Jul 2003 11:58:16 +0200
Message-ID: <3F02ACB8.9040604@web.de>


Eric Parker wrote:

> "Marek Lange" <marek.lange_at_web.de> wrote in message
> news:3F02A2D0.9090902_at_web.de...
> 

>>Hi,
>>
>>following problem (oracle8): I want to insert a value with precision
>>(#.##) in a number(10,2) column. It works but the values which end with
>>.0 or .00 are always truncated:
>>
>>100.00 --> 100
>>1000.0 --> 1000
>>
>>Is there a way to prevent this and to show the decimal places although
>>they are 0?
>>
>>Thanks,
>>
>>-marek
>>
> 
> 
> Marek
> 
> This is a problem with the way your application is formatting the data.
> You haven't supplied any information about what is doing the formatting.
> 
> SQL> SELECT to_char(a, '9999.99') from t;
> 
> TO_CHAR(
> --------
>     9.99
>    10.00
>    10.01

I made sure that my application writes the data to the database with the correct precisions. Your suggestion seems to be fitting my needs, although I don't understand the usage of the format:

Using to_char(10000.0, '9999.99')

shows #######

Using to_char(10000.0, '99999.99')

shows 10000.00

Is there a way to generalize this for all digits?

Thanks,

-marek Received on Wed Jul 02 2003 - 04:58:16 CDT

Original text of this message

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