Daniel Kasak wrote:
Chris Ripley wrote:

What's a good (or best) field type for money or
currency data.  Mysql doesn't have a MONEY type for
structure, so what would I have the best luck with?

double


No way. You should *never* use floating-point types for currency if you care about precision. You'll experience all sorts of weird rounding and comparison errors. See [1] for more information.

DECIMAL would suit your needs better -- from [2]: "The DECIMAL and NUMERIC types [...] are used to store values for which it is important to preserve exact precision, for example with monetary data."

[1] http://en.wikipedia.org/wiki/Floating_point
[2] http://dev.mysql.com/doc/mysql/en/numeric-types.html
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to