Well, in one case he supplied a string, not a number.
It most likely was promoted to a float before is was saved.
Jones, Clifton R [CC] wrote:
>No, I think he was surprised to find mySQL rounded two identical values
>*differently*.. please read his posting for the results....
>
>
>
>
>>-----Original Message-----
>>From: gerald_clark [mailto:gerald_clark@stripped]
>>Sent: Friday, April 11, 2003 9:33 AM
>>To: Matt Loschert
>>Cc: mysql@stripped
>>Subject: Re: rounding/truncation of decimal fields
>>
>>
>>Why do you find this surprising?
>>You defined the field to have 2 deciimal places..
>>
>>Matt Loschert wrote:
>>
>>
>>
>>>I have quick question about rounding and/or truncation of a
>>>
>>>
>>decimal table
>>
>>
>>>field. I ran into this unexpectedly and found it surprising.
>>>
>>>Given the following input:
>>>
>>>
>>> DROP TABLE IF EXISTS test1;
>>> CREATE TABLE test1 (id tinyint, truncated decimal(12,2));
>>> INSERT INTO test1 VALUES (1, '0.004');
>>> INSERT INTO test1 VALUES (2, 0.004 );
>>> INSERT INTO test1 VALUES (3, '0.005');
>>> INSERT INTO test1 VALUES (4, 0.005 );
>>> SELECT * FROM test1;
>>> SELECT VERSION();
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>--
>>MySQL General Mailing List
>>For list archives: http://lists.mysql.com/mysql
>>To unsubscribe:
>>http://lists.mysql.com/mysql?unsub=1
>>
>>
>>
>
>
>