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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -