[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
decimal(8,2) rounding bug or still "to be expected" behaviour?
Hello
CREATE TABLE deci (deci decimal(8,2));
INSERT INTO deci VALUES (-2427.88);
INSERT INTO deci VALUES (2427.89);
INSERT INTO deci VALUES (-0.01);
select sum(deci) as s from deci having s<0;
+-------+
| s |
+-------+
| -0.00 |
+-------+
Well for the values given above - monetary values - the datatype seems just
fine. I would even be ok if mysql treats something that is really rounded
up to 0 but not in fact 0 as <0 but in this case I cannot see the reason.
Is this a bug or is the decimal type just evil or how should *I* behave
when having such a table?
thanks & bye,
-christian-
--
Christian Hammers WESTEND GmbH - Aachen und Dueren Tel 0241/701333-0
ch@xxxxxxxxxxx Internet & Security for Professionals Fax 0241/911879
WESTEND ist CISCO Systems Partner - Premium Certified
---------------------------------------------------------------------
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 <mysql-thread67760@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
This mailing list archive is a service of Copilot Consulting.