Loading ...
Sorry, an error occurred while loading the content.
 

Formatting a number

Expand Messages
  • Jaime A Stuardo Bahamondes
    I want to format a number so that the decimal point is the comma. I m using to_char(1234.056789, 99,990.9999 ) but it s displayed 1,234.0568. I want to be
    Message 1 of 4 , Apr 1, 2003
      I want to format a number so that the decimal point is the comma. I'm using to_char(1234.056789, '99,990.9999')
      but it's displayed 1,234.0568. I want to be displayed: 1.234,0568.

      How can I do it?
      Thanks

      Jaime
    • Norman Dunbar
      Hi Jaime, Two methods : alter session set NLS_NUMERIC_CHARACTERS = ,. ; SELECT TO_CHAR(1234.056789, 99G990D9999 ) FROM dual; You need to specify the G and
      Message 2 of 4 , Apr 1, 2003
        Hi Jaime,

        Two methods :
        alter session set NLS_NUMERIC_CHARACTERS = ',.';
        SELECT TO_CHAR(1234.056789, '99G990D9999')
        FROM dual;

        You need to specify the 'G' and 'D' for Group and Decimal separators in the
        number format string, not the dot and comma you were using.

        or if you don't have privs to or wish to alter session :

        SELECT TO_CHAR(1234.056789, '99G990D9999', 'nls_numeric_characters =
        '',.''')
        FROM dual;

        should do the trick.

        And this time, I've tested to make sure they work :o)

        Cheers,
        Norman.

        -------------------------------------
        Norman Dunbar
        Database/Unix administrator
        Lynx Financial Systems Ltd.
        mailto:Norman.Dunbar@...
        Tel: 0113 289 6265
        Fax: 0113 289 3146
        URL: http://www.Lynx-FS.com
        -------------------------------------

        This email is intended only for the use of the addressees named above and
        may be confidential or legally privileged. If you are not an addressee you
        must not read it and must not use any information contained in it, nor copy
        it, nor inform any person other than Lynx Financial Systems or the
        addressees of its existence or contents. If you have received this email
        and are not a named addressee, please delete it and notify the Lynx
        Financial Systems IT Department on 0113 2892990.
      • Borders Michael (dbm1mxb)
        Or maybe this... SELECT TRANSLATE(TO_CHAR(1234.056789, 99,990.9999 ), ., , ,. ) FROM dual; ... From: Norman Dunbar [mailto:norman.dunbar@lfs.co.uk] Sent:
        Message 3 of 4 , Apr 1, 2003
          Or maybe this...
          SELECT
          TRANSLATE(TO_CHAR(1234.056789, '99,990.9999'),'.,',',.')
          FROM dual;

          -----Original Message-----
          From: Norman Dunbar [mailto:norman.dunbar@...]
          Sent: Tuesday, April 01, 2003 8:23 AM
          To: 'toad@yahoogroups.com'
          Subject: RE: [toad] Formatting a number


          Hi Jaime,

          Two methods :
          alter session set NLS_NUMERIC_CHARACTERS = ',.';
          SELECT TO_CHAR(1234.056789, '99G990D9999')
          FROM dual;

          You need to specify the 'G' and 'D' for Group and Decimal separators in the
          number format string, not the dot and comma you were using.

          or if you don't have privs to or wish to alter session :

          SELECT TO_CHAR(1234.056789, '99G990D9999', 'nls_numeric_characters =
          '',.''')
          FROM dual;

          should do the trick.

          And this time, I've tested to make sure they work :o)

          Cheers,
          Norman.

          -------------------------------------
          Norman Dunbar
          Database/Unix administrator
          Lynx Financial Systems Ltd.
          mailto:Norman.Dunbar@...
          Tel: 0113 289 6265
          Fax: 0113 289 3146
          URL: http://www.Lynx-FS.com
          -------------------------------------

          This email is intended only for the use of the addressees named above and
          may be confidential or legally privileged. If you are not an addressee you
          must not read it and must not use any information contained in it, nor copy
          it, nor inform any person other than Lynx Financial Systems or the
          addressees of its existence or contents. If you have received this email
          and are not a named addressee, please delete it and notify the Lynx
          Financial Systems IT Department on 0113 2892990.

          To download the beta: http://www.toadsoft.com/beta.zip
          To unsubscribe, mailto:toad-unsubscribe@yahoogroups.com
          Archives: http://www.yahoogroups.com/list/toad

          Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        • Jaime A Stuardo Bahamondes
          Thanks a lot Norman !!
          Message 4 of 4 , Apr 1, 2003
            Thanks a lot Norman !!

            > -----Mensaje original-----
            > De: Norman Dunbar [SMTP:norman.dunbar@...]
            > Enviado el: Martes 1 de Abril de 2003 09:23
            > Para: 'toad@yahoogroups.com'
            > Asunto: RE: [toad] Formatting a number
            >
            > Hi Jaime,
            >
            > Two methods :
            > alter session set NLS_NUMERIC_CHARACTERS = ',.';
            > SELECT TO_CHAR(1234.056789, '99G990D9999')
            > FROM dual;
            >
            > You need to specify the 'G' and 'D' for Group and Decimal separators in the
            > number format string, not the dot and comma you were using.
            >
            > or if you don't have privs to or wish to alter session :
            >
            > SELECT TO_CHAR(1234.056789, '99G990D9999', 'nls_numeric_characters =
            > '',.''')
            > FROM dual;
            >
            > should do the trick.
            >
            > And this time, I've tested to make sure they work :o)
            >
            > Cheers,
            > Norman.
            >
            > -------------------------------------
            > Norman Dunbar
            > Database/Unix administrator
            > Lynx Financial Systems Ltd.
            > mailto:Norman.Dunbar@...
            > Tel: 0113 289 6265
            > Fax: 0113 289 3146
            > URL: http://www.Lynx-FS.com
            > -------------------------------------
            >
            > This email is intended only for the use of the addressees named above and
            > may be confidential or legally privileged. If you are not an addressee you
            > must not read it and must not use any information contained in it, nor copy
            > it, nor inform any person other than Lynx Financial Systems or the
            > addressees of its existence or contents. If you have received this email
            > and are not a named addressee, please delete it and notify the Lynx
            > Financial Systems IT Department on 0113 2892990.
            >
            > To download the beta: http://www.toadsoft.com/beta.zip
            > To unsubscribe, mailto:toad-unsubscribe@yahoogroups.com
            > Archives: http://www.yahoogroups.com/list/toad
            >
            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.