472,373 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to add $ sign to number data type?

Hi Everybody,

I am fetching number data from a table. i want to add '$' sign to this data.
I already tried "TO_CHAR" function. This works fine but it converts number data type to string data type. I want it to be in number format only.
So, is there any way or any function that add '$' sign to number data without converting its data type?

Amit parmar
Jan 30 '08 #1
5 6963
debasisdas
8,127 Expert 4TB
If you want to use string data it will be string only.

If retrieving only for display then try to concadinate the $ with the data.
Jan 30 '08 #2
YOU HAVE TO USE TO_CHAR FUNCTION.

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT TO_CHAR(SAL,'$99,999.00') FROM EMP;
  3. declare
  4.    v_num number;
  5. begin
  6.    v_num := to_number('$1234567.67','$9999999.99');
  7. end;
  8.  
  9.  
Jan 30 '08 #3
If you want to use string data it will be string only.

If retrieving only for display then try to concadinate the $ with the data.
Hi Debasisdas,

Thanks for your reply,
As i said, i want it in number or money data type only. If i concatenate number with $ sign then the result would be in string data type that i don’t want.
If you know how to convert number data type to money data type then it would also helpful to me.

Amit Parmar
Jan 31 '08 #4
amitpatel66
2,367 Expert 2GB
Hi Debasisdas,

Thanks for your reply,
As i said, i want it in number or money data type only. If i concatenate number with $ sign then the result would be in string data type that i don’t want.
If you know how to convert number data type to money data type then it would also helpful to me.

Amit Parmar
Oracle does not provide any thing as MONEY DATA TYPE.

Check out post #3 of this thread on how to concateate "$" symbol before the salary or any amount column to be displayed as $000.00.
Jan 31 '08 #5
debasisdas
8,127 Expert 4TB
Hi Debasisdas,

Thanks for your reply,
As i said, i want it in number or money data type only. If i concatenate number with $ sign then the result would be in string data type that i don’t want.
If you know how to convert number data type to money data type then it would also helpful to me.

Amit Parmar
There is nothing like money datatype in oracle .
If you want to store pure numbers store in numbers else go for char type.
Jan 31 '08 #6

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

Similar topics

9
by: cooldv | last post by:
i know how to replace the sign " when SUBMITTING a form in asp by this code: message = Replace(usermessage, "'", "''"). My problem is DISPLAYING data in an asp FORM, from an an access database,...
12
by: tarmat | last post by:
sorry for this silly little question, but whats the function to grab the sign of a value?
4
by: thomas | last post by:
Anyone know how can I get a £ sign in the cell of a table that has been output by an xsl page I've tried <td>&#x00A3;<xsl:apply-templates select="./price" /></td> <td>£<xsl:apply-templates...
1
by: lbbs | last post by:
Newbie, so please don't flame me. I am just starting to learn access. I seem a feature in access a while ago, but don't remember what it was called. I seen project lab example that had, a plus...
10
by: Sona | last post by:
Hi, Could someone please explain what sign-extension means? If I have a hex number 0x55, how does this get sign-extended? Can a sign-extended counterpart be equal to -91? In a program I'm...
1
by: qwerty | last post by:
My end goal is to have a script that takes user input from one pageA, submits to pageB which then displays the parameter values entered on PageA. My problem is that the values are being displayed...
6
by: Steve K. | last post by:
I recall a few months ago coming across an article allowing for encoding (or converting?) xml and html documents into sign language as well as brail for deaf and blind people, and that they were...
11
by: =?ISO-8859-1?Q?Konrad_M=FChler?= | last post by:
Hi, a simple question: Which standard function in c++ gives me the sign of a number? Thanks Konrad
3
by: Shailesh Patel | last post by:
Hi, Is there any formatting that adds + or - sign before number. Normally it adds - sigh if number is negative and no sign if positive. I want to add + sign when number is positive. Thank you...
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 required to effectively administer and manage Oracle...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
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 synthesis of my design into a bitstream, not the C++...
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. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.