Please correct me or explain me how this works or otherwise it seems quite like a really bad bug.
Here is an example of query where I am summing two numbers and rounding the number two digits after the decimal point:
select round(sum(x.some_number),2.0) round_sum,
round((0.2440 + 0.0010),2.0) other_number,
(0.2440 + 0.0010) just_number,
from (select 0.2440 as some_number
select 0.0010 as some_number) x;
the result for all of these calculations are:
round_sum other_number just_number other_round_number
0.24 0.24 0.2450 0.24
All of these results are incorrect except “just_number”.
I have double checked with calculator, excel or whatever other tool which is smart enough to round numbers. And all of these give out result: 0.25!!! Which is correct.
How can you explain that?
And it is on v7.1