Home » SQL & PL/SQL » SQL & PL/SQL » formating numbers
formating numbers [message #243871] Sun, 10 June 2007 09:56 Go to next message
mats_95
Messages: 7
Registered: May 2006
Junior Member
hi,
I have a numeric field.Let say 546.I want to retrive data with 2 deicmals even if there are no decimals.That is in this case the data output should be 546.00.Please advice how I can do this.
Re: formating numbers [message #243872 is a reply to message #243871] Sun, 10 June 2007 10:01 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
TO_CHAR

Regards
Michel
Re: formating numbers [message #243876 is a reply to message #243871] Sun, 10 June 2007 11:50 Go to previous message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
SQL*Plus solution:

SQL> col num format 990.00
SQL> SELECT 546 AS num FROM dual;

    NUM
-------
 546.00


SQL solutions:

SQL> SELECT TO_CHAR(546, '990.00') FROM dual;

TO_CHAR
-------
 546.00


Previous Topic: Doubt in for each row trigger
Next Topic: ORA-00604 problem
Goto Forum:
  


Current Time: Sat Dec 10 02:56:19 CST 2016

Total time taken to generate the page: 0.08584 seconds