Matt Frye wrote:

What's the best numeric type in mysql for dealing with money, i.e.
dollars and cents?  Float, decimal, fixed?  Informed suggestions
appreciated.

There's a train of thought amongst some folks that it's best to store and calculate "money" amounts as integers, in terms of cents, instead of floating point types in terms of dollars. Ie, 1 dollar becomes '100' instead of '1.00'. The idea is to eliminate the possiblity of rounding errors that can be introduced by conversions to and from floating point types, and in floating point arithmetic itself.

Outside of that, I know nothing specific to mysql to indicate
on field type over another.


TTYL,

Phil
--
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc

Reply via email to