Let's say a query like this
select (low + high)/2 'avg'
from tbl_values
when executed in SQL Server 2012 I get results like 166.65
,
but when I bind the same query to a C# datagridview it will be 166.64999999999998
.
Why is SQL rounding when I didn't ask it to? And if it's by default, why isn't it shown as rounded in the datagridview?
For a given query, the executed result should be the same for SQL and C#... or not!