erring to all 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 t
s" in the sense of comparing two
> values in a SQL statement? versus simply retrieving or inserting
> a value?
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.
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 on in the app layer :-)
--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design === (+1) 408-938-05
:[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
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
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 IN
e, float, etc. Can anyone give me an idea, 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 ef
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:
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
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
* 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
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]
; <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, 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
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 rea
* 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 inte
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 values
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
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
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 statemen
error, John!
Cheers
/rudy
-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
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
tored as char :)
>
> -Original Message-
> From: John Hicks [mailto:[EMAIL 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
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. But it
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 anot
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
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?
Regar
;Mike(mickako)Blezien" <[EMAIL PROTECTED]>
>>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:
>>&g
quot; <[EMAIL PROTECTED]>
>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 mysq
>>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
=-=-=-=-=-=-=-
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
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
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
data 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 int
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 w
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
[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
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 accura
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 Ser
Saqib Shaikh writes:
> I'm interested to know what data type people consider suitable for storing
> currency.
As far as I know, the way to do it is to store the number of
the smallest possible unit as an integer of some sort. You'll
never run into any odd floating point-to-de
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 and
On Tue, 05 Jun 2001 12:53:50 -0500 (CDT), Don Read <[EMAIL PROTECTED]> wrote:
We use DECIMAL(X,X) for all our currency related data columns, works perfectly.
Usually DECIMAL(9,2) seems to work the best.
>>
>>On 05-Jun-01 Aaron Clausen wrote:
>>> I've been ha
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
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 currenc
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
--
45 matches
Mail list logo