In the last episode (May 29), wang shuming said:
> Hi,
>  table a1
> 
> qty int(10) , unitpri float(10,2)
> 350            19.80
>   ...
> 350     19.80    (total 48 lines)
> 
> select sum(qty*unitpri)  from a1
> 332639.99  ,it should return  332640.00
> 
> mysql version 4.1.19

If you want exact arithmetic, don't use FLOATs. Use the DECIMAL type
instead:

http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html

-- 
        Dan Nelson
        [EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to