I have the following code
DECLARE @m FLOAT=213456789.55
DECLARE @sql VARCHAR(MAX)='INSERT INTO Test VALUES('+CONVERT(VARCHAR,@m,1)+')'
EXEC(@sql)
but the result is 213456790
instead of 213456789.55
When I try to write CONVERT(VARCHAR,213456789.55,1)
it then returns 213456789.55
not 213456790
How do I solve this?
EDITS
Declaring @m as Decimal like following DECLARE @m DECIMAL(18,2)=213456789.55
solved the issue but I want to know if there is another solution for using float. Thanks