[TriLUG] Money in mysql

Jeremy Portzer jeremyp at pobox.com
Thu Oct 14 10:27:11 EDT 2004


On Thu, 2004-10-14 at 10:24, Joseph Mack wrote:
> 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.
> 
> In the old days all money calculations were done in BCD (binary coded decimal)
> which was designed for money and was exact for floating point addition/subtraction. 
> Does mysql have BCD?

I don't think BCD is found much these days, but as already discussed,
the equivalent form is to do everything in cents, but divide by 100 for
displaying in dollars.

Jeremy
-- 
/---------------------------------------------------------------------\
| Jeremy Portzer        jeremyp at pobox.com      trilug.org/~jeremy     |
| GPG Fingerprint: 712D 77C7 AB2D 2130 989F  E135 6F9F F7BC CC1A 7B92 |
\---------------------------------------------------------------------/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.trilug.org/pipermail/trilug/attachments/20041014/55383b21/attachment.pgp>


More information about the TriLUG mailing list