[TriLUG] Money in mysql

Phillip Rhodes mindcrime at cpphacker.co.uk
Thu Oct 14 07:25:47 EDT 2004


Matt Frye wrote:

>>I haven't been much help at all.  :-)
> 
> 
> Actually, you have.  Thanks for that ACM resource too. I haven't yet
> decided how to handle the currency issue in this new db, but I don't
> expect to be doing to much math beyond statistical analysis.  This new
> project is mainly about donations and development for nonprofits.


Cool.  If you're mainly going to be dealing with just summing
columns of numbers, you won't have to worry much about the
floating point stuff.  You should still store and calculate
things as integer numbers of cents ( amazingly you can get
fp errors even doing just addition and subtraction), but otherwise
you should be OK.  Especially if the bean-counters can deal with the
possibility that a report that displays an average, or something
of that ilk, might be off by a penny every now and then.

TTYL,

Phil



More information about the TriLUG mailing list