If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > Is It Possible to Format The output of a number?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Dec 2012
Posts: 30
Is It Possible to Format The output of a number?

Hi to All,

with a simple query of the type :

Code:
SELECT tot FROM clients;
I obtain output format
Code:
       tot        |
------------------+
94,010000000000001|


But I'd wish to obtain this output format :

Code:
 tot |
-----+
94,01|

Is it possible?
If yes, could Someone tell how it is possible?

Tanks in advance.
Gianni Pinna.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Nov 2003
Posts: 2,779
Code:
select to_char(tot,'99.00') FROM clients;
More details in the manual: http://www.postgresql.org/docs/curre...ormatting.html
__________________
I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

Tips for good questions:

http://tkyte.blogspot.de/2005/06/how...questions.html
http://wiki.postgresql.org/wiki/SlowQueryQuestions
http://catb.org/esr/faqs/smart-questions.html
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Dec 2012
Posts: 30
Hi Shammat,
Tank You very much for Your Kind prompt reply.

Many Rgrds
Gianni Pinna.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On