?
I'd say storing and converting doesn't matter much, but currency
amounts are often summed up (say for a monthly report over a huge
table). For this INT should be a big win.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com
of it. For the new DECIMAL type, storage requirements
are less than before, and comparisons are faster.
Either way, do you have a feel (or access to any studies) for the
impact of using DECIMAL instead of INTEGER for currency? I'd just
wonder if it's enough to make up for all the required conversions
going
Hello,
I am seeking to create a table to hold prices for products. I am not sure what
type would be best. According to the docs, I have many choices, dec, double,
float, etc. Can anyone give me an idea, of which is the proper choice for
handling US currency like so: 1500.99
Thanks,
Scott K
Scott Purcell wrote:
I am seeking to create a table to hold prices for products. I am
not sure what type would be best. According to the docs, I have many
choices, dec, double, float, etc. Can anyone give me an idea, of
which is the proper choice for handling US currency like so: 1500.99
I
, of
which is the proper choice for handling US currency like so: 1500.99
I can't imagine any reason to use a type other than DECIMAL for a
currency value.
A reason could be performance. Storing cent values in an INT field is
more efficient.
--
MySQL General Mailing List
For list archives: http
Harald Fuchs wrote:
I can't imagine any reason to use a type other than DECIMAL for a
currency value.
A reason could be performance. Storing cent values in an INT field is
more efficient.
Are you saying that storing and/or retrieving a DECIMAL value takes
appreciably more time than an INTEGER
At 15:24 -0700 4/29/05, Hassan Schroeder wrote:
Harald Fuchs wrote:
I can't imagine any reason to use a type other than DECIMAL for a
currency value.
A reason could be performance. Storing cent values in an INT field is
more efficient.
Are you saying that storing and/or retrieving a DECIMAL value
:[EMAIL PROTECTED]
Sent: samedi 30 avril 2005 00:25
To: mysql@lists.mysql.com
Subject: Re: Seeking advice on currency type
Harald Fuchs wrote:
I can't imagine any reason to use a type other than DECIMAL for a
currency value.
A reason could be performance. Storing cent values in an INT field
DECIMAL instead of INTEGER for currency? I'd just
wonder if it's enough to make up for all the required conversions
going on in the app layer :-)
--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
My final issue is inserting a currency, $500.00 for example into a field
that is a BigDecimal(10,2).
Anyone have any thoughts on how to do that within a SQL statement?
dan
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com
Hello.
Ive spent some day(s) probing the web to find a solution to this problem:
A table-column for storing currency float(10,2).
As my users are punches the currency value like this 255,55, with a comma
as decimal point, MySQL stores this value as zero (0.00).
I quess the reason
, January 12, 2004 11:33 AM
Subject: Storing currency values
Hello.
I've spent some day(s) probing the web to find a solution to this problem:
A table-column for storing currency - float(10,2).
As my users are punches the currency value like this 255,55, with a comma
as decimal point, MySQL
Just convert the format of the input in your program before saving the value. In
VB/ASP us can do: replace(255,55,,,.)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
* Asbjørn Konstad
Ive spent some day(s) probing the web to find a solution to this problem:
A table-column for storing currency float(10,2).
As my users are punches the currency value like this 255,55,
with a comma as decimal point, MySQL stores this value as zero (0.00).
I quess
Hello!
I'm trying to write some kind of small accounting software and I got
stuck with the problem that doing a SUM() on values of a DECIMAL(7,2)
row did show problems with (relatively) small values (like 173.58). I
found a message explaining that mysql uses doubles internly to compute
the
* Jean-Pierre Schwickerath
I'm trying to write some kind of small accounting software and I got
stuck with the problem that doing a SUM() on values of a DECIMAL(7,2)
row did show problems with (relatively) small values (like 173.58). I
found a message explaining that mysql uses doubles
I´m having some problems with currency´s fields. Actually I dont know what
mysql´s field typeI have to choose..^
I wanna input this value: U$32.00 but, when I write the query: Select
'field' from table it returns..
'32' and not 32.00.
Which select statement do i have to write
At 17:32 -0300 10/2/03, Fabio Bernardo wrote:
I´m having some problems with currency´s fields. Actually I dont know what
mysql´s field typeI have to choose..^
I wanna input this value: U$32.00 but, when I write the query: Select
'field' from table it returns..
'32' and not 32.00
I am guessing that you are trying to find a MySQL data type of Currency,
which does not exist.
I generally use a column that is DECIMAL(150,2) for US currency.
--Scott
At 01:32 PM 10/2/2003, Fabio Bernardo wrote:
I´m having some problems with currency´s fields. Actually I dont know what
-Original Message-
From: John Hicks [mailto:[EMAIL PROTECTED]
Sent: woensdag 16 juli 2003 22:03
To: Rudy Metzger; [EMAIL PROTECTED]
Subject: Re: Best practice column type for storing decimal currency
amounts?
Thanks for the reply, Rudy.
My source for the statement that decimal values
PROTECTED]
Subject: Best practice column type for storing decimal currency amounts?
Is there an accepted best practice on whether to store
decimal currency amounts (e.g. dollars and cents) in MySQL
decimal column types?
Certainly, the most straightforward way is to use decimal
columns
PROTECTED]
Sent: dinsdag 15 juli 2003 21:39
To: [EMAIL PROTECTED]
Subject: Best practice column type for storing decimal
currency amounts?
Is there an accepted best practice on whether to store
decimal currency amounts (e.g. dollars and cents) in
MySQL decimal column types?
Certainly
On 16 Jul 2003 at 16:02, John Hicks wrote:
Thanks for the reply, Rudy.
My source for the statement that decimal values are stored
as strings is:
http://www.mysql.com/doc/en/Numeric_types.html :
DECIMAL values may very well be stored as strings, but presumably
you're going to do some
Is there an accepted best practice on whether to store
decimal currency amounts (e.g. dollars and cents) in MySQL
decimal column types?
Certainly, the most straightforward way is to use decimal
columns. But it appears that such values are stored as
ASCII strings, which would be inefficient
Description:
While trying to login to the MySQL database (as root), I failed for no
apparent reason.
I believe this migth be because my password includes the ¤ (Euro / European
currency) char.
It works _perfectly_ if I remove that one char or replace it with another
Hi,
I just want to know if mysql can set the output of a certain currency to
this pattern :
$1,500.00
If I use a comma on a certain amount then I add it up to another amount with
a comma I get the wrong
answer. I'm using php mysql by the way.
Any hints on this one?
Regards,
Delz
this is a php question, try:
http://www.php.net/manual/en/function.number-format.php
Hi,
I just want to know if mysql can set the output of a certain currency to
this pattern :
$1,500.00
If I use a comma on a certain amount then I add it up to another amount with
a comma I get
Hi there
Does mysql have a currency type, or is it best to just use a varchar or a
float?
Thanks
Desmond
_
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com
Desmond Lee wrote:
Hi there
Does mysql have a currency type, or is it best to just use a varchar or a
float?
Thanks
Desmond
I normally use the DECIMAL(6,2) data type, works very for currency values.
--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain
]
Reply-To: [EMAIL PROTECTED]
To: Desmond Lee [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: currency type
Date: Tue, 30 Jul 2002 11:36:30 -0500
Desmond Lee wrote:
Hi there
Does mysql have a currency type, or is it best to just use a varchar or
a
float?
Thanks
Desmond
I
]
CC: [EMAIL PROTECTED]
Subject: Re: currency type
Date: Tue, 30 Jul 2002 11:36:30 -0500
Desmond Lee wrote:
Hi there
Does mysql have a currency type, or is it best to just use a varchar or a
float?
Thanks
Desmond
I normally use the DECIMAL(6,2) data type, works very for currency values
Does anyone have a quick tip on how to format a float/numeric in the
following currency format with a query?
$xx,xxx.xx
Thanks!
Graeme
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual
SELECT FORMAT(yourvalue,2)
- Original Message -
From: Graeme B. Davis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 06, 2002 10:16 PM
Subject: formatting currency in mysql
Does anyone have a quick tip on how to format a float/numeric in the
following currency format
type for currency?
For currency, it depends on your use of course, but fixed-point is
usually easiest. Where you fix the point depends on the precision
you require.
For display purposes it is easiest to use the smallest currency
unit as an integer (e.g. cents). For conversions, daily interest
Using MySQL 3.23.47, is the best data type for small currency
float(4) ? This is for prices of items in a shopping cart for example
t-shirts.
What is the difference in using float vs decimal? I know I don't need double.
--
Michael
__
||| Michael Collins |||
||| Kuwago Web Services
Michael Collins wrote:
Using MySQL 3.23.47, is the best data type for small currency float(4) ?
This is for prices of items in a shopping cart for example t-shirts.
What is the difference in using float vs decimal? I know I don't need
double.
Float has accuracy problems at large ranges
[database,sql,query,table]
Shankar Unni wrote:
Float has accuracy problems at large ranges. A typical float has a fixed
number of so-called significant digits. For 32-bit IEEE floats, that's
about 6.
Of course, in the interests of fairness, I should note that typical doubles
(64-bit
For currency, it depends on your use of course, but fixed-point is
usually easiest. Where you fix the point depends on the precision
you require.
For display purposes it is easiest to use the smallest currency
unit as an integer (e.g. cents). For conversions, daily interest,
etc, you can do
At 3:10 PM -0800 1/26/02, Shankar Unni wrote:
Of course, in the interests of fairness, I should note that typical doubles
(64-bit IEEE) have about 15 digits of accuracy, which are generally enough,
as long as you never exceed 10**13 dollars (i.e. no US govt budget work
:-)). You only have to
Hi,
I'm interested to know what data type people consider suitable for storing
currency. In a table in my database for a university assignment, i have:
create table Products(
...
price double(4,2) not null,
...);
However it has been suggested to me that double(4,2) is inappropriate
I've been having some problems with currency calculations in SQL queries.
I've been using Double, but often get some very small rounding errors. What
is the recommended column type for currency in MySQL?
Aaron
-
Before
convert everything to pennies and use integers?
Aaron Clausen wrote:
I've been having some problems with currency calculations in SQL queries.
I've been using Double, but often get some very small rounding errors. What
is the recommended column type for currency in MySQL?
Aaron
On 05-Jun-01 Aaron Clausen wrote:
I've been having some problems with currency calculations in SQL
queries.
I've been using Double, but often get some very small rounding
errors. What
is the recommended column type for currency in MySQL?
DECIMAL(9,2)
Regards,
--
Don Read
43 matches
Mail list logo