INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Format number

Format number

(OP)
I already had some help here thread796-1756243: Format number #0+00.00 with VB.NET, but would like to have the same in Oracle. Mainly for reports.

I have a need to display (format) a number this way.
Have this:    Display this:
       0        0+00.00
       1        0+01.00
     1.5        0+01.50
      20        0+20.00
   35.75        0+35.75
  123400     1234+00.00
55566.75      555+66.75 

I did try this:
Select TO_CHAR(1000, '0+00.00') AS STATION
from dual

but that does not work. Error: Invalid number format model sad

Is there any way to format the number in Oracle the way I want?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.

RE: Format number

Hi,
you can define the plus sign as your group sperator and put it in the desired position:

CODE

select to_char(55566.75,'99990G00D00','NLS_NUMERIC_CHARACTERS= ''.+'' ') from dual 

RE: Format number

It's not a group separator, it is scientific notation and you do it like this.

1* select to_char(55566.75,'99999.99EEEE') FROM DUAL;


TO_CHAR(55
----------
5.56E+04

Bill
Lead Application Developer
New York State, USA

RE: Format number

(OP)
Thank you stefanhei, that exactly what I needed smile

Beilstwh,
This has nothing to do with scientific notation, but I appreciate the effort.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close