Decimal or Float?

Decimal or Float?

am 23.03.2005 16:56:43 von ekraft

Hey All,

Which one would be better? I'm simply just storing decimal values. I'm
not doing any direct calculations with the values yet, as that's all
handled within the application before submission, but I'm seeing
instances of both float and decimal usage and I'm not sure which way I
should go.

Thanks,

Ed

************************************************************ ********
This e-mail and any attachments thereto, is intended only for use by=0D
the addressee(s) named herein and may contain privileged and/or=0D
confidential information.

This communication is being sent to you solely for the purpose of
furthering the relationship between the parties. Any use of this
information for any other purpose, without the prior express=0D
written consent of Asset Acceptance LLC, is strictly forbidden.

If you are not the intended recipient of this e-mail, you are
hereby notified any dissemination, distribution or copying of
this email, and any attachments thereto, is strictly prohibited.
If you receive this email in error please immediately notify me
at the above telephone number and permanently delete the original
copy and any copy of any e-mail, and any printout thereof.

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg

RE: Decimal or Float?

am 23.03.2005 22:58:14 von jbonnett

Section 12.2 Numeric Types in the MySQL manual should tell you what you
want. FLOAT and DOUBLE are approximate numbers, ideal for measured data
that you want to do lots of calculations on. DECIMAL data is stored to a
specified number of decimal places exactly and is suitable for things
that usually have an exact number of decimal places like money. They
also suit columns you don't do much calculation on.

If you store a bunch of money values in a FLOAT column and add them up,
you might find the total is a cent or so out. If you do the same thing
with a DECIMAL column, it should be exact to however many decimal places
you have asked for. Calculating with DECIMAL is slower than FLOAT I
should think.

John Bonnett

-----Original Message-----
From: Kraft, Ed [mailto:ekraft@Assetacceptance.com]=20
Sent: Thursday, 24 March 2005 2:27 AM
To: myodbc@lists.mysql.com
Subject: Decimal or Float?


Hey All,

Which one would be better? I'm simply just storing decimal values. I'm
not doing any direct calculations with the values yet, as that's all
handled within the application before submission, but I'm seeing
instances of both float and decimal usage and I'm not sure which way I
should go.

Thanks,

Ed

************************************************************ ********
This e-mail and any attachments thereto, is intended only for use by

the addressee(s) named herein and may contain privileged and/or

confidential information.

This communication is being sent to you solely for the purpose of
furthering the relationship between the parties. Any use of this
information for any other purpose, without the prior express

written consent of Asset Acceptance LLC, is strictly forbidden.

If you are not the intended recipient of this e-mail, you are
hereby notified any dissemination, distribution or copying of
this email, and any attachments thereto, is strictly prohibited.
If you receive this email in error please immediately notify me
at the above telephone number and permanently delete the original
copy and any copy of any e-mail, and any printout thereof.

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg