Results 1 to 3 of 3
  1. #1
    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.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,825
    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

  3. #3
    Join Date
    Dec 2012
    Posts
    30
    Hi Shammat,
    Tank You very much for Your Kind prompt reply.

    Many Rgrds
    Gianni Pinna.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •