locked
format field in Oracle package RRS feed

  • Question

  • User-1075092149 posted

    how can i write a dollar sign with 2 decimal in sql by Oracle.

    i would like to format the field $ 100.00

    how can i format in pl/sql

    Tuesday, September 25, 2012 12:14 AM

Answers

  • User269602965 posted
    SQL> select to_char(304.2,'$99990.99') as dollars from dual;
    
    DOLLARS
    ----------
       $304.20
    
    select to_char(mynumber,'$99990.99') as mydollars from mytable;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 26, 2012 7:16 PM

All replies

  • User-1075092149 posted

    anyone help~

    Tuesday, September 25, 2012 2:04 AM
  • User269602965 posted
    SQL> select to_char(304.2,'$99990.99') as dollars from dual;
    
    DOLLARS
    ----------
       $304.20
    
    select to_char(mynumber,'$99990.99') as mydollars from mytable;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 26, 2012 7:16 PM