DECLARE @f AS FLOAT = '29545428.022495';
SELECT CAST(@f AS NUMERIC(28, 14)) AS value;
29545428.02249500200000
Today I've read this example. I understand the problem of floating point numbers but do not understand the result of this casting. How it works?
UPDATE
First, we can replace varchar in the first line, the result will be the same.
DECLARE @f AS FLOAT = 29545428.022495;
Second, I think the problem is in casting. Try the following code.
DECLARE @f AS FLOAT = 29545428.022495;
select @f - 29545428;
0,0224950015544891
Maybe it is the reason of 002
in the end.
It works with other numbers.
UPDATE 2
OK, I think I understand it in a wrong way. Here's a related question and the answer.