472,353 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Number Formatting

Stang02GT
1,208 Expert 1GB
I am trying to get negative numbers to display as (1,23)

the current format is as follows...

Expand|Select|Wrap|Line Numbers
  1. '9G990D00', 'NLS_NUMERIC_CHARACTERS = '',.'' 
If I edit 9G990D00 to (9G990D00) would that do it?
Jun 3 '08 #1
6 2095
r035198x
13,262 8TB
I am trying to get negative numbers to display as (1,23)

the current format is as follows...

Expand|Select|Wrap|Line Numbers
  1. '9G990D00', 'NLS_NUMERIC_CHARACTERS = '',.'' 
If I edit 9G990D00 to (9G990D00) would that do it?
The dirty thoughts going in my head right now yield
Expand|Select|Wrap|Line Numbers
  1. select replace (replace (to_char('-5000.8','9999.99PR'), '<', '('), '>', ')') from dual
Jun 3 '08 #2
Stang02GT
1,208 Expert 1GB
The dirty thoughts going in my head right now yield
Expand|Select|Wrap|Line Numbers
  1. select replace (replace (to_char('-5000.8','9999.99PR'), '<', '('), '>', ')') from dual

That worked nicely. Thanks very much! :)
Jun 3 '08 #3
amitpatel66
2,367 Expert 2GB
Try this as well:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT '('||TO_CHAR(-5000.8 * -1,'9999.99')||')' FROM dual
  3.  
  4.  
Jun 5 '08 #4
r035198x
13,262 8TB
Try this as well:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT '('||TO_CHAR(-5000.8 * -1,'9999.99')||')' FROM dual
  3.  
  4.  
That would work only for negative numbers?
Jun 5 '08 #5
amitpatel66
2,367 Expert 2GB
That would work only for negative numbers?
Yap. the OP wanted to display the negative numbers in that particular format.
Btw, the best way would be:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT '('||TO_CHAR(ABS(-5800.0),'9999.99')||')' from dual
  3.  
  4.  
Jun 9 '08 #6
r035198x
13,262 8TB
..Btw, the best way would be:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT '('||TO_CHAR(ABS(-5800.0),'9999.99')||')' from dual
  3.  
  4.  
Not unless they have both negative and positive numbers and want to format their negative numbers that way.
Jun 9 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Douglas | last post by:
Gday, How would I format a number so that: TheValue = 32500 Displays in the TextBox as: $32,500.00
0
by: Josh Harris | last post by:
Here is my issue: I have a datagrid that is populated with a datatable. I want the columns of the datagrid to be sortable. I also want to...
2
by: Steve Peterson | last post by:
Hi I have an app where I have to deal with both Spanish & American formatting. I have a string that represents a number that I need to convert to...
29
by: james | last post by:
I have a problem that at first glance seems not that hard to figure out. But, so far, the answer has escaped me. I have an old database file that...
4
by: Brian Henry | last post by:
I have phone numbers like this in a data table 123-435-1234 1231231234 432.234.2321 they all have different formatting, what I want to do is...
1
by: womblesjc | last post by:
I have a data bound Details View control in asp.net 2.0 that formats a phone number. The 'Default Mode' for the control is set to Edit. The phone...
2
by: dcyale | last post by:
I have a report with the following paragraph: ="This BA presents a " & & " determination for the " & & " and associated habitat. We would...
109
by: jmcgill | last post by:
Hello. Is there a method for computing the number of digits, in a given numeric base, of N factorial, without actually computing the factorial? ...
9
by: Nebojsa4 | last post by:
Hi. First, sorry on my weak English to all. Qusetion: How to read (in VB) Manufacturer serial number of Hard disk drive? Not volume/serial...
2
Pittaman
by: Pittaman | last post by:
Hello I am creating some crystal reports (for visual studio 2005) based on the content of certain .NET objects. I'm doing this in .NET 2.0. ...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.