Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format number 1

Status
Not open for further replies.

Andrzejek

Programmer
Jan 10, 2006
8,486
5
38
US
I already had some help here thread796-1756243 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.
[pre]
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[/pre]

I did try this:[tt]
Select TO_CHAR(1000, '0+00.00') AS STATION
from dual[/tt]
but that does not work. Error: Invalid number format model :-(

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.
 
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
 
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
 
Thank you stefanhei, that exactly what I needed :)

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top