473,326 Members | 2,128 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,326 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 7068
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.