473,569 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

remove $ from money field

Should be a simple question.

When selecting a field that is of type money, how can I remove the $
when selected?

example: $10.00 would return as 10.00

-Robby
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #1
3 2753
On Fri, 2003-08-08 at 20:04, Robby Russell wrote:
Should be a simple question.

When selecting a field that is of type money, how can I remove the $
when selected?

example: $10.00 would return as 10.00


money as a datatype is deprecated, use numeric(9,2) instead (or whatever
precision you need).

Datatypes:
http://developer.postgresql.org/docs...ype-money.html
http://developer.postgresql.org/docs...UMERIC-DECIMAL

Formatting:
http://developer.postgresql.org/docs...ormatting.html

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 11 '05 #2
Robby Russell <rr******@comma ndprompt.com> writes:
When selecting a field that is of type money, how can I remove the $
when selected?


Actually, almost the only thing money does for you is put in the $ sign
;-). I'd recommend using type numeric instead, if you have any desire
for more flexibility.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 11 '05 #3
As others have said, money is deprecated. I used this function to
migrate some money data once; you could use it to reformat data if you
wanted.

CREATE OR REPLACE FUNCTION x_money(money) RETURNS decimal AS '

set moneydata $1

regsub -all {[,$]} $moneydata {} workable

return $workable

' language 'pltclu';
Robert Treat

On Fri, 2003-08-08 at 20:04, Robby Russell wrote:
Should be a simple question.

When selecting a field that is of type money, how can I remove the $
when selected?

example: $10.00 would return as 10.00

-Robby

--
PostgreSQL :: The Enterprise Open Source Database
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
3502
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing the code. Thank you. .. Facundo
9
36947
by: Ken | last post by:
I am trying to create one image using JavaScript; then later in the script remove the image - not just remove the src. The following creates the image, but I have been unable to remove it. How do I structure document.getElementById('num1').removeChild(image_display); ? <input type=file name="picture1" onChange="image(this.value,...
1
2342
by: Stephane Charette | last post by:
QUICK VERSION: How do I create an index on a field of type "MONEY"? ----------------------------- LONG VERSION: I have a table with a field of type "money". I very often need to access records by the purchase price so I thought I'd create an index to help out my selects: CREATE INDEX purchasepriceidx ON mytable (purchaseprice);
12
17869
by: David Garamond | last post by:
What do people recommend for storing money amounts? I've seen people use NUMERIC(18,3) and other use NUMERIC(18,4). Which one is more appropriate and why? This is considering various existing currencies, some having low rates (like IDR, in which you can have large amount up to hundreds of trillions) and some high rates (like USD, in which you...
4
9416
by: digitalavatar | last post by:
I am having a problem with my Access 2000 front end to a SQL 7 or 2000 database. I create a table in SQL with a field named, say, amt, data type MONEY. When I link the table in Access using ODBC, the field is defined as CURRENCY, as expected. Now, if I use SQL to populate the field with a 3- or 4-decimal amount like 1.234, it appears in...
3
18471
by: Ghost | last post by:
Hello. I have some problem to read Money Type Field from my database. I do so: I'm using SqlDataReader object to select some records and I have "float" type variable to store result. I write: myFloatVar = (float)mySqlDataReader; When this line executed the cast exception occurs.
2
4830
by: Alberto | last post by:
I have a decimal field in a SQL Server DataBase who stores money and I want to show it in a TextBox and in a ListView controls in C#. If I do: txtMoney.Text = Convert.ToSingle(dr); I see something like: "4.0000" instead "4.00 ?" How can I solve this? Thank you very much
4
9272
by: ahaupt | last post by:
Hi all, I'm trying to get a null value into a sql money field through a SqlCommand in c#. However, I get this lovely message (which sparks loads of happy emotions in this overworked body): Disallowed implicit conversion from data type nvarchar to data type money, table 'xxxx', column 'xxxx'. Use the CONVERT function to run
4
3694
by: Ronald S. Cook | last post by:
We're designing the data model for a project. The app will be in .NET, the database will be in SQL Server 2005. I'm a little confused on type conversion between the two and which I should choose. I found this good comparison chart: http://msdn2.microsoft.com/en-us/library/ms131092.aspx But for monetary amounts, it looks like decimal...
0
7697
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7968
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.