For currency, it depends on your use of course, but fixed-point is
usually easiest.  Where you fix the point depends on the precision
you require.  

For display purposes it is easiest to use the smallest currency
unit as an integer (e.g. cents).  For conversions, daily interest,
etc, you can do the same but with a few extra decimal points to 
keep rounding errors small and predictable.

For cases where the errors would tend to accumulate (banking etc)
I think you need a Double.

I can't imagine a case where I would use a Float.

Steve

> Of course, in the interests of fairness, I should note that typical doubles
> (64-bit IEEE) have about 15 digits of accuracy, which are generally enough,
> as long as you never exceed 10**13 dollars (i.e. no US govt budget work
> :-)). You only have to worry about precise rounding with doubles.
> --
> Shankar
> 
> (PS Of course, given the typical accuracy with which budget numbers are
> tossed around, one would suspect that our fine reps use floats to
> manipulate them..)
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to