This is a discussion on do not cut decimal places within the Oracle Database forums, part of the Database Server Software category; --> Hi, following problem (oracle8): I want to insert a value with precision (#.##) in a number(10,2) column. It works ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 Lange" <marek.lange@web.de> wrote in message news:3F02A2D0.9090902@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 SQL> SELECT a from t; A ---------- 9.99 10 10.01 SQL> HTH eric |
| ||||
| Originally posted by Marek Lange > 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 You do not have a problem, you have a misunderstanding. You are confusing the storage of numbers with the display format. If you want to see 2 decimal places, format the output. e.g. in SQL: select TO_CHAR(value,'99990.00') from tab; -- Posted via http://dbforums.com |