Symptom
- Results of using function ROUND seems to be not always as expected.
In this query one value seems to be rounded properly and the other one seems to be truncated, not rounded. Why ?
drop table if exists tbl;
--
create table tbl(clmn double);
--
insert into tbl(clmn) values (0.9559);
insert into tbl(clmn) values (143.4753);
--
select clmn --
, convert(numeric(22,17),clmn) as clmn_expanded -- returns type numeric(22,17) to make true stored value fully visible
, round(clmn, 2) as round_to_2dec --
, round(clmn, 2)*100 as round_to_2dec_mult_100 --
, cast (round(clmn, 2)*100 as integer) as