Why couldn't you use float(10,2) ... just an example ... where the first
number in the parentheses is the total characters for the number and the
second number represents how many of those are right of the decimal point?)
Computers represent data in binary format at floating point numbers are quite innaccurate. Going into the details on why is for another place and time; feel free to search Google w.r.t. floating point vs. fixed point values. When you're working with money (for example), you don't want that kind of imprecision, so DECIMAL (which doesn't use floating point values) comes into play. For one company I work with, all their values are stored as long integers for pennies. $100 is stored as 10000. That way they just drop a decimal before displaying the last two digits of the value and they're all set (not using MySQL).
Old versions of Quick Basic, by way of reference had this neat bug:
a = 0 for i = 1 to 100 a = a + 0.01 next i print a
... printed 0.99 or 1.01 depending on your platform.
-- Michael T. Babcock C.T.O., FibreSpeed Ltd. http://www.fibrespeed.net/~mbabcock
--------------------------------------------------------------------- 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