473,506 Members | 17,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Turn off "money" formatting?

Is it possible to turn off the "$" and "," that appear in "money" formatted
columns so I can dump the table in a numeric format?

The man page hints that lc_monetary controls the formatting but I
cannot find any clues on what to do...

Apparently money cannot be cast to anything.

I don't think it will be hard to write a custom tcl/perl
script that takes a "copy checks to...." command to do the task
but I would like a cleaner solution....
Jerry
Nov 23 '05 #1
4 5127
If you need to be able to cast money to numeric, you can just write your
own cast. This is one of the things about postgres that I dearly love.

You could probably even write the cast function in SQL using regular
expressions.

Then, you just write a query with an explicit cast, e.g. SELECT foo ::
numeric FROM bar;

I noticed in the docs that the money type is actually deprecated, so you
probably want to consider converting your column to the numeric type
regardless.

BJ

Jerry wrote:
Is it possible to turn off the "$" and "," that appear in "money" formatted
columns so I can dump the table in a numeric format?

The man page hints that lc_monetary controls the formatting but I
cannot find any clues on what to do...

Apparently money cannot be cast to anything.

I don't think it will be hard to write a custom tcl/perl
script that takes a "copy checks to...." command to do the task
but I would like a cleaner solution....
Jerry

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #2
If you need to be able to cast money to numeric, you can just write your
own cast. This is one of the things about postgres that I dearly love.

You could probably even write the cast function in SQL using regular
expressions.

Then, you just write a query with an explicit cast, e.g. SELECT foo ::
numeric FROM bar;

I noticed in the docs that the money type is actually deprecated, so you
probably want to consider converting your column to the numeric type
regardless.

BJ

Jerry wrote:
Is it possible to turn off the "$" and "," that appear in "money" formatted
columns so I can dump the table in a numeric format?

The man page hints that lc_monetary controls the formatting but I
cannot find any clues on what to do...

Apparently money cannot be cast to anything.

I don't think it will be hard to write a custom tcl/perl
script that takes a "copy checks to...." command to do the task
but I would like a cleaner solution....
Jerry

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #3
On Sun, Jun 06, 2004 at 01:44:26PM -0700, Jerry wrote:
Is it possible to turn off the "$" and "," that appear in "money" formatted
columns so I can dump the table in a numeric format?


Don't use "money" datetype. You can use other numerical datetype and
currency symbol add to final result when you need it. For example you
can use "numeric" and to_char(.., '999L') for result formatting.

I think a lot of things about "money" you found in PostgreSQL lists
archives.

.. and .. Please, read docs:

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

Note: The money type is deprecated. Use numeric or decimal
instead, in combination with the to_char function.

:-)
Karel

--
Karel Zak <za***@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #4
On Sun, Jun 06, 2004 at 01:44:26PM -0700, Jerry wrote:
Is it possible to turn off the "$" and "," that appear in "money" formatted
columns so I can dump the table in a numeric format?


Don't use "money" datetype. You can use other numerical datetype and
currency symbol add to final result when you need it. For example you
can use "numeric" and to_char(.., '999L') for result formatting.

I think a lot of things about "money" you found in PostgreSQL lists
archives.

.. and .. Please, read docs:

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

Note: The money type is deprecated. Use numeric or decimal
instead, in combination with the to_char function.

:-)
Karel

--
Karel Zak <za***@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #5

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

Similar topics

1
2309
by: Chumley the Walrus | last post by:
I'm trying to insert a value into sql dbase, the value "amount" is a money datatype (currency). Below is the parameter for the "amount" value: cmd.Parameters.Add(New SQLParameter("@amount",...
99
6011
by: Jim Hubbard | last post by:
It seems that Microsoft not only does not need the classic Visual Basic developer army (the largest army of developers the world has ever seen), but now they don't need ANY Windows developer at a...
11
3113
by: David | last post by:
Comments on a program called PHP Page Generator? ( http://www.phppagegenerator.com) I received a email offer of $100 and the product appears to allow quick generation of code for SQL web...
1
2325
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...
0
337
by: Jerry | last post by:
Is it possible to turn off the "$" and "," that appear in "money" formatted columns so I can dump the table in a numeric format? The man page hints that lc_monetary controls the formatting but I...
60
4970
by: Dave | last post by:
I'm never quite sure whether to use "this." or not when referring to fields or properties in the same class. It obviously works just fine without it but sometimes I wonder if using this....
2
15890
by: Randy Smith | last post by:
Hi, Does anyone have any good techniques on how to convert an SQL Server 2005 "money" datatype into the ASP.Net "double" datatype? OR, should we be using "decimal" at both ends? TIA, Randy...
1
1254
by: jonesgirl620 | last post by:
I want to select a filed that is declared as money and have the output of that select statement be decial point free. Do I use Cast?
1
7023
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...
0
7479
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...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
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...
0
4702
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...
0
3188
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...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
410
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...

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.