473,395 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 2147
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 format the numeric columns such as two decimal places...
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 Int32 before I enter it in the database. The...
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 has the date(s) stored in it as number of days. An...
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 get them all formatted like this (123) 123-1234
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 number field is a template field and I can...
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 appreciate you processing the biological opinion by " &...
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? For example, 8! has 5 digits in base 10; 10! has...
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 number of C:, D:, etc. partitons. For reading...
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. For one of them I'm using a Cross-table to summarize...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.