Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format decimal

Status
Not open for further replies.

octopuce

MIS
May 6, 2003
2
PH
Hi,

I have a field defined like 10 long with 2 decimals. When the data is 14.00. With the select statement, SQL + show the value is 14. I would like to display 14.00. Is there a way to set the format with some "SET" command.

Thank you.

Annie
 
How do you show the value?

If the data type is decimal(10,2) in the database it's not an SQL issue.
 
Do you mean formatting a numeric column?
Code:
SQL> create table test_it
  2  (       amount  number
  3  );
SQL> insert into test_it values('14');
SQL> insert into test_it values('38.29');
SQL> insert into test_it values('7503.46');
SQL> insert into test_it values('0');
SQL> 
SQL> select to_char(amount,'999,990.99') AMOUNT
  2  from   test_it
  3  order by amount;

AMOUNT
-----------
       0.00
      14.00
      38.29
   7,503.46

Code:
select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
When posting code, please use TGML to help readability. Thanks!
 
Thank you for the answer BJCooper. That's what I meant

Annie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top