mysql - Rounded numbers returned as '0.999999999992345' sometimes -
i have report should return along lines of
select brand, round(sum(count * price) / sum(count), 2) ... group brand, ...;
the problem is, sometimes 9990.32999999999992345 in perl code instead of 9990.33 direct sql request returns.
the number starts looking way right after fetchrow_hashref, if ever does. same number can come in 'good' or 'bad' form in different queries, same way in specific query.
how can track down?
i can think of couple of causes of this, first:
does make difference put concat( '', ... )
around round? version of perl using? perl -v:nvtype report?
Comments
Post a Comment